note 14298 added to function.ereg.php
| From: | skozombie at bigfoot dot com | Date: | Wed, 25 Jul 2001 17:02:15 +0000 |
| Subject: | note 14298 added to function.ereg.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15834@lists.php.net to get a copy of this message | ||
Don't forget that '\' is a special character for regular expressions. Not only do you
have to escape it for the strings you also need to escape it for the regexp. So if you want to match
lines that start with "\" you would need to use:
ereg("^\\\\(.*)", $mystring, $reg)
AND NOT ereg("^\\(.*)", $mystring, $reg) as it may appear at first glance.
http://www.php.net/manual/en/function.ereg.php