python - Regex matching MAC address -
i'm trying valid mac addresses 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 , 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 matches.
- you have remove anchors - ^,- $
- you have add - a-zin character set.. or make searches case insensitive- (?i)(i modifier)
following work:
([0-9a-fa-f]{2}[:]){5}([0-9a-fa-f]{2}) see demo
Comments
Post a Comment