[PHP] Re: Help on pregreplace

2009-08-19 Thread tedd
At 10:51 AM -0400 8/18/09, Al wrote: Merlin Morgenstern wrote: Hi there, I am highlighting keywords with the help of pregreplace. This works great with one limitation. If the word that has to be replaced contains a slash, preg throws an error. So far I could not find a fix. Can someone help?

[PHP] Re: Help on pregreplace

2009-08-18 Thread Vladan Stefanovic
You should check out preg_quote() function which puts a backslash in front of characters (escapes them) that have a special meaning in regular expressions. Regards, Vladan Stefanovic "Merlin Morgenstern" wrote in message news:12.62.22194.004ba...@pb1.pair.com... Hi there, I am highlightin

[PHP] Re: Help on pregreplace

2009-08-18 Thread Al
Merlin Morgenstern wrote: Hi there, I am highlighting keywords with the help of pregreplace. This works great with one limitation. If the word that has to be replaced contains a slash, preg throws an error. So far I could not find a fix. Can someone help? Here is the code: $patte