On Sunday 11 February 2001 13:09, zbynek wrote:

> I want to check if given username consists only of letters of English
> alphabet, numbers, or "_".

> Wouldn't it be simpler to use regular expressions? How would I do it?

if (preg_match ('/^\w+$/', $Username))
        echo "'$Username' is ok<br>";
else
        echo "'$Username' contains invalid chars"

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"use the source, luke." (obi-wan gnuobi)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to