View: A MAC address regex

  1. 11 years ago by spirit and saved by 1 other
    1. # Works with dash "-" and colon ":" as a separator
    2. # The ā€œ/iā€ modifier at the end makes it case-insensitive (Perl-like syntax)
    3. /^([0-9A-F]{2}[:-]){5}[0-9A-F]{2}$/i
    4.  
    5. # General syntax (match lower and upper case)
    6. ^([0-9a-fA-F]{2}[:-]){5}[0-9a-fA-F]{2}$
    Paste this in your website: <script type="text/javascript" src="http://www.posteet.com/embed/429"></script>

0 comment about "A MAC address regex"