RegExp in preg_match function returning browser error

前端 未结 4 1931
有刺的猬
有刺的猬 2020-11-28 07:06

The following function breaks with the regexp I\'ve provided in the $pattern variable. If I change the regexp I\'m fine, so I think that\'s the problem. I\'m not seeing th

4条回答
  •  囚心锁ツ
    2020-11-28 07:48

    I had the same problem and you need to chenge the pattern to something like

    $pattern = '|/your pattern/|s';
    

    The 's' on the end basically means treat the string as a single line.

提交回复
热议问题