Page 1 of 1

MAC - Cisco

Posted: Wed Jul 27, 2011 8:57 pm
by Jesse
Format any input mac address (collection of 12 hex digits ignoring any non-hex-digits as if they were messy punctuation) in lowercase dotted 4's the way Cisco gear likes it:

Code: Select all

Set s_reTrimWS = New RegExp
s_reTrimWS.Pattern = "[^0-9a-f]"
s_reTrimWS.Global  = True
 
Clipboard.Value = s_reTrimWS.Replace( LCase(Clipboard.Value), "" )
 
s_reTrimWS.Pattern = "(....)(....)(....)"
 
Clipboard.Value = s_reTrimWS.Replace( Clipboard.Value, "$1.$2.$3" )