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
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.