From: <[EMAIL PROTECTED]>

> Regular Expressions: How can I indicate that the contents of a term 
> (user input*) needs to be treated as 'non-operators/control characters' 
> (as *word* to match in that exact way)?
> (* Because the term is a user's input I can't escape the control 
> characters manually.)
> 
> Example:
> $result = 
> preg_replace('/('.$termWithOptionalBold.')(<\/?span[^>]*>)*()/si', 
> '<span class="highlight">\1</span>', $result);
> 
> [If $termWithOptionalBold is a "." (period) for example, any char will 
> be matched--instead of only the "."]
> 
> Any suggestions?

I got one!

http://www.php.net/manual/en/function.preg-quote.php

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to