note 24578 added to ref.regex
| From: | bps7j at yahoo dot com | Date: | Wed, 21 Aug 2002 23:40:36 +0000 |
| Subject: | note 24578 added to ref.regex | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35340@lists.php.net to get a copy of this message | ||
Something that really got me: I'm used to using Perl's regexps, and so I used \s to check
for a whitespace character in a password on a website. My PHP book (Wrox Press, Professional PHP
Programming) agreed with me that this is exactly the same as [ \r\n\t\f\v], but it's NOT. In
fact, what it did was keep anyone from joining the site if they put an 's' in their
password! So beware, check for subtle differences between what you're used to and PHP.
[[:space:]] works fine, by the way.
I'm going to use the pcre functions from now on... I like Perl :o)
--
http://www.php.net/manual/en/ref.regex.php
http://master.php.net/manage/user-notes.php?action=edit+24578
http://master.php.net/manage/user-notes.php?action=delete+24578
http://master.php.net/manage/user-notes.php?action=reject+24578