The problem is you’re not including a delimiter before and after the pattern, therefore PHP is thinking that your delimiter is “^”, but of course you’re missing the closing delimiter. This is an easy problem to solve, just have a quick read about delimiters in the manual first.