I tried adding a period to the end but a string will a period still returns
false

function is_alphanumeric($string) 
{
        return (preg_match("/^[A-Za-z0-9.]+$/i", $string));
}


-----Original Message-----
From: Dan Joseph [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 05, 2003 2:42 PM
To: Php-General (E-mail)
Subject: RE: [PHP] Allowing punctuation marks in regular expressions


Hi,

>       return (preg_match("/^[a-z0-9]+$/i", $string));

        That a-z0-9 is where you can do it.  Just add ! or . or ? to the
end:

        a-z0-9!?.

        Also, if you want upper case letters, make sure you add A-Z:

        A-Za-z0-9!?.

-Dan Joseph

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

Reply via email to