I have developed a regex that works fine in Regex Coach (a freeware regex testing program), but it doesn't work when I try it in preg_replace with PHP.
This is my regex to match opening and closing html tag: "linkhtml"
and my PHP:
$str = preg_replace('/</?linkhtml[^>]*/?>/', '', $str);
When I run this in the php debugger I get the error:
Unknown modifier '?'
Any idea what I'm doing wrong?