in reply to Insert colons into a MAC address
If you want to keep using a regexp, then:
$mac =~ s/^(..)(..)(..)(..)(..)(..)$/$1:$2:$3:$4:$5:$6/ if $mac =~ /^[0-9A-F]{12}$/i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Insert colons into a MAC address
by CountZero (Bishop) on Jan 13, 2012 at 21:35 UTC |