RE: [PHP] Regex question
| From: | Jon Haworth | Date: | Wed, 09 Jan 2002 14:35:18 +0000 |
| Subject: | RE: [PHP] Regex question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79913@lists.php.net to get a copy of this message | ||
> If you want the [ to be escaped in the regex you have to "double-escape"
it:
> $x = "\ \["; (sorry, the two \ should be together without a space but my
> stupid mail-app converts the string thinking it's an network address)
> so $x will contain "\[" as you want ( the first backslash escapes the
> second).
Hi Stefan,
Thanks very much for that, it does make sense :-)
Unfortunately it still hasn't fixed the problem... I suppose my question has
now boiled down to "do I need to escape !, <, or - in a regex?" :-)
Cheers
Jon