January 9, 2009 2

Cisco Mac Address Regex

By in SysAdmin

Reference post…..I needed to match a cisco format mac address, not the best, but it works…

String: 0000.0c07.ac01

Matching regex: ([0-9A-Fa-f]){4}\.([0-9A-Fa-f]){4}\.([0-9A-Fa-f]){4}

String: 00:00:0c:07:ac:01

Matching regex: ([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}

2 Responses to “Cisco Mac Address Regex”

  1. [...] http://www.copyandwaste.com » Cisco Mac Address Regex – Regex to match a Cisco MAC address (0000.0c). [...]

  2. [...] http://www.copyandwaste.com » Cisco Mac Address Regex – Regex to match a Cisco MAC address (0000.0c). [...]

Leave a Reply