MAC Regex
A regular expression for matching MAC addresses.
Installation
npm i --save mac-regex
Usage
var mac = require('mac-regex');
mac({ exact: true }).test('aa-bb-cc-dd-ee-ff')
mac({ exact: true }).test('aa:bb:cc:dd:ee:ff')
mac({ exact: true }).test('aa:bb:cc:dd:ee:ff ')
mac({ exact: true }).test('kljhsdf')
mac().test('aa:bb:cc:dd:ee:ff ')
mac().test('kljhsdf')
'11:22:aa:44:55:33 11:22:aa:44:55:33'.match(mac())
Acknowledgements
License
MIT
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Crafted with <3 by John Otander.