Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re: Regular Expression for MAC Addressby jrynz (Initiate) |
on May 20, 2007 at 02:12 UTC ( [id://616378]=note: print w/replies, xml ) | Need Help?? |
Try this one: ((?:(\d{1,2}|[a-fA-F]{1,2}){2})(?::|-*)){6} Example Usage (extract MAC address): NB: This will also work with MAC like: my $string = 'tu0 1500 <Link> 00:00:f8:05:c8:20';
In Section
Seekers of Perl Wisdom
|
|