delimiter - Regex for multiple MAC addresses separated by comma? -
delimiter - Regex for multiple MAC addresses separated by comma? -
i know right regex matching multiple mac addresses separated delimiter, such comma.
the regex single mac address be: ^([0-9a-fa-f]{2}[:-]){5}[0-9a-fa-f]{2}$
.
so multiple mac addresses delimited comma, figured ^(([0-9a-fa-f]{2}[:-]){5}[0-9a-fa-f]{2},?)){+}$
trick.
where going wrong? help appreciated, thanks.
edit: people have asked went wrong. well, put, regex not work. allow come in single (valid) mac address, flagged invalid mac address. same goes multiple mac addresses delimited comma.
the regex needed validator textbox on asp .net page. if more details needed, allow me know.
^([0-9a-fa-f]{2}[:-]){5}[0-9a-fa-f]{2}(,([0-9a-fa-f]{2}[:-]){5}[0-9a-fa-f]{2})*$
see regex comma delimited list details making regex match delimited list. need set regex mac address followed grouping containing comma , regex mac address matched 0 or more times. in attempted solution comma optional.
regex delimiter mac-address
Comments
Post a Comment