I am just learning them, but I think something like this may be in order...
I know that you would use the | (or) operator.

if(! (ereg('^[a-z|A-Z|0-9|\-]+$', $fn) && (ereg('^[a-z|A-Z|0-9|\-]+$', $fs)))
         Either $fn or $sn failed the match

-Jason Garber

At 04:41 PM 11/13/2001 +0930, [EMAIL PROTECTED] wrote:
>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
>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.
>Adam Whitehead
>Systems Developer - Computer Support and Maintenance
>Ph. (08) 8936 3164 ** Mobile (0411) 241 120
>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]

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