Re: preg_match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



John Nichel wrote:
Personally, I have never used \\ in PCRE when looking for things like spaces (\s), word boundraries (\b), etc. and it's all worked out fine.

It will work fine, but only because those (\s and \b) just happen to not be special characters in PHP *at this time*.

It's sloppy programming because the backslash is known to be a special character, and \s or \b could conceivably become special characters at some time in the future. It's unlikely, but possible.

Not only that, but it makes it more likely that you'll forget and put \n when you meant \\n, \r when you meant \\r, \t when you meant \\t, and so on...

Jasper

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux