Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add validator for MAC address. #458

Merged
merged 3 commits into from
Dec 1, 2015
Merged

Conversation

cyrilschumacher
Copy link
Contributor

Adds validator for MAC addresses (with tests) and update the README.

@@ -52,6 +52,8 @@
var isbn10Maybe = /^(?:[0-9]{9}X|[0-9]{10})$/
, isbn13Maybe = /^(?:[0-9]{13})$/;

var macAddressMaybe = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why macAddressMaybe and not macAddress? The IP and ISBN regexes are named as such because the functions contain additional validation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I renamed the variable.

@chriso
Copy link
Collaborator

chriso commented Dec 1, 2015

Looks good! Thanks for the PR.

@chriso
Copy link
Collaborator

chriso commented Dec 1, 2015

Great, thanks.

chriso added a commit that referenced this pull request Dec 1, 2015
Add validator for MAC address.
@chriso chriso merged commit 07d7b61 into validatorjs:master Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants