RegEx with preg_match to find and replace a SIMILAR string

前端 未结 1 864
眼角桃花
眼角桃花 2020-12-12 03:32

I am using regular expressions with preg_replace() in order to find and replace a sentence in a piece of text. The $search_string contains plain te

相关标签:
1条回答
  • 2020-12-12 04:30

    Not a very efficient way of doing it but it should workout for you,

    preg_replace('Two.*?years.*?in.*?the.*?company.*?has.*?expanded.*?to.*?35.*?cities.*?five.*?of.*?which.*?are.*?outside.*?the.*?U\.S\..*?Plus.*?in.*?April.*?ClassPass.*?acquired.*?its.*?main.*?competitor.*?Fitmob\.', '<span class=\'smth\'>$0</span>', $subject);
    
    0 讨论(0)
提交回复
热议问题