eregi( "^wm(li|si|wi)[0-9]{6}[a-z]?$", $wm_id)

That should do it...  tear it apart and understand it  :)


Part of the problem was in the alternation in the li|si|wi

Part of the problem was that the + would accept sisi or wisilisiwi

With {min,max}... if they are the same number, you only need one

Also, ? is a substitute for {0,1} (means the same thing)

See it here:  http://www.lcounty.com/is/website/test_center/test_eregi.php


---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: A. Mikkelsen [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, December 05, 2002 8:39 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] eregi problem
> 
> 
> Hey
> 
> I'm trying to validate these strings
> 
>                 wmli001234    wmli001234a
> 
> using this
> 
> if( eregi( "^" .
>     "wm" .                                       //first 2 letters
>     "((li)*(si)*(wi)*)+" .                   //next 2 letters 
> shal be ether
> LI / SI / WI
>     "[0-9]{6,6}" .                           //next 6 numbers
>     "[a-z]{0,1}" .                            //if extra 
> letter (only 1
> letter)
>     "$", $wm_id))
>     return TRUE;
>     else return FALSE;
> 
> 
> can anyone help me ?????
> 
> 
> Anders
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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

Reply via email to