What is the correct regular expression for matching MAC addresses ? I googled about that but, most of questions and answers are incomplete. They only provide a regular expre
Below Regex Pattern will help to manage all kinds of the above listed patterns
"([MACmac]?){1}([:.-]?){1}(([0-9A-Fa-f]{2,3}[:.-]?){4,6})"
here at end i added {4,6} because some pattern as requested below is expecting the group of 3 for 4 time. else if you are looking ONLY for the default on which is usually group of 2 characters 6 times then you can use the below one.
"([MACmac]?){1}([:.-]?){1}(([0-9A-Fa-f]{2}[:.-]?){6})"
hope this helps all.