I'm trying to get all valid MAC addresses from this string:
00:1e:68:51:4f:a9 <-> 00:1a:8c:10:ad:30 9 540 8 336 17 876 90.457130000 198.0143
I've tried this and a few other regexes:
^([0-9A-F]{2}[:]){5}([0-9A-F]{2})$
Regex 101 here:
https://regex101.com/r/kI5nI6/1
I can't figure out why I'm not getting any matches.
You have to remove the anchors
^
and$
You have to add
a-z
in your character set.. or make the searches case insensitive with(?i)
(i modifier)Following will work:
See DEMO