Hi All-
This is probably very simple for most of you.
I have the following statement
if ((ereg("[^[:alnum:]]",$fn)) || (ereg("[^[:alnum:]]",$sn))) {
// Do something here
}
What it's doing is checking two variables to make sure they contain only
alphanumeric
characters.
I have a requirement that hyphens (-) be allowed in $fn and $sn as well.
What do I need
to add to the regular expression to allow hyphens?
I know this is a relatively silly question. I plan on buying a book on
regular expressions
today and learning as much as I need to know about building them.
Cheers.
Regards,
Adam Whitehead
Systems Developer - Computer Support and Maintenance
Ph. (08) 8936 3164 ** Mobile (0411) 241 120
E-mail: [EMAIL PROTECTED]
--
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]