Skip to content

Instantly share code, notes, and snippets.

@fromdev
Created July 20, 2018 09:01
Show Gist options
  • Save fromdev/cff00195c4cbe8334dab22f9a541dd6a to your computer and use it in GitHub Desktop.
Save fromdev/cff00195c4cbe8334dab22f9a541dd6a to your computer and use it in GitHub Desktop.
Validate Vehicle Identification Number (VIN) Using JavaScript Regular Expressions
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