[PHP] Escaping Regex Chars with addcslashes()

2004-09-29 Thread Nick Wilson
Hi all, 

If i want to find a url on a page, there are some chars i need to escape
right?

like '/' and '?'

do i also need to escape '.'?
Are there any other things that might pop up in a url that I can escape
with addcslashes()?

Much thanks
-- 
Nick W

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



Re: [PHP] Escaping Regex Chars with addcslashes()

2004-09-29 Thread Marek Kilimajer
Nick Wilson wrote:
Hi all, 

If i want to find a url on a page, there are some chars i need to escape
right?
like '/' and '?'
do i also need to escape '.'?
Are there any other things that might pop up in a url that I can escape
with addcslashes()?
Much thanks
Don't use posix regexp, but use perl compatible instead. It has
preg_quote() function that is intended for this purpose.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Escaping Regex Chars with addcslashes()

2004-09-29 Thread Nick Wilson

* and then Marek Kilimajer declared
 If i want to find a url on a page, there are some chars i need to escape
 right?
 
 like '/' and '?'
 
 do i also need to escape '.'?
 Are there any other things that might pop up in a url that I can escape
 with addcslashes()?

 Don't use posix regexp, but use perl compatible instead. It has
 preg_quote() function that is intended for this purpose.

I'll go look it up, thanks Marek ;-)


-- 
Nick W

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