Regular expression help?
| From: | Jas | Date: | Mon, 02 Feb 2004 19:15:36 +0000 |
| Subject: | Regular expression help? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176597@lists.php.net to get a copy of this message | ||
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'])
so it should match 2 characters 0-9a-fA-F
each block of 2 characters is followed by a : and repreated in 6 blocks.
Jas