RE: [PHP] [newbie] Can I use regular expressions?
| From: | PHPBeginner.com | Date: | Sun, 11 Feb 2001 12:25:26 +0000 |
| Subject: | RE: [PHP] [newbie] Can I use regular expressions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39118@lists.php.net to get a copy of this message | ||
or ...
if(ereg("[[:alnum:]_ ]", $name))
result = 1;
Sincerely,
Maxim Maletsky
Founder, Chief Developer
PHPBeginner.com (Where PHP Begins)
maxim@phpbeginner.com
www.phpbeginner.com
-----Original Message-----
From: zbynek [mailto:maillist@atlas.cz]
Sent: Sunday, February 11, 2001 9:09 PM
To: php-general@lists.php.net
Subject: [PHP] [newbie] Can I use regular expressions?
Hi there!
I want to check if given username consists only of letters of English
alphabet, numbers, or "_".
I can go through the string and check every character.
Wouldn't it be simpler to use regular expressions? How would I do it?
These usernames are OK: _john_, 0123bla, foo
These are wrong: x#y, t&boo, 100%
Thanks for your advice.
zbynek
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net