[thelist] regex: ' causing problems

Dunstan Orchard dunstan at 1976design.com
Fri Mar 28 11:41:21 CST 2003

Hi there,

I'm doing regular expressions on text with an apostrophe/single quote in it, 
and it's giving me errors:

I'm already preg_quote()ing to cancel out the brackets that appear in the 
text, but I can't seem to get rid of the '.

Any ideas?

btw, this is my expression:

$postbody = preg_replace(preg_quote("'$term2' i", '/'), "$part1<span 
class=\"highlight1\">$part2</span></a>", $postbody);

thanks very much - dunstan

Dorset, England

More information about the thelist mailing list