* Jas <[EMAIL PROTECTED]>:
> Not sure if anyone knows of a good way to match strings of this type...
> 00:02:8b:0c:2f:09
>
> I have tried this but its not working.
>                        
> !eregi("^[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}\:[0-9a-fA-F]{2}$",$_POST['mac'])

Use the perl compatible regexps instead:

!preg_match('/^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$/', $_POST['mac'])

This searches for XX: 5 followed by XX, where XX is 0-9, A-F, or a-f. I
_think_ the POSIX regexps can do some grouping like this as well, but
I'm not absolutely sure.

-- 
Matthew Weier O'Phinney
Webmaster and IT Specialist
National Gardening Association
802-863-5251 x156
mailto:[EMAIL PROTECTED]
http://www.garden.org
http://www.kidsgardening.com

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

Reply via email to