Created
July 20, 2018 09:01
-
-
Save fromdev/cff00195c4cbe8334dab22f9a541dd6a to your computer and use it in GitHub Desktop.
Validate Vehicle Identification Number (VIN) Using JavaScript Regular Expressions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validateVin(vin) { | |
var re = new RegExp("^[A-HJ-NPR-Z\\d]{8}[\\dX][A-HJ-NPR-Z\\d]{2}\\d{6}$"); | |
return vin.match(re); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment