RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^([A-Z\d]{3})[A-Z]{2}\d{2}([A-Z\d]{1})([X\d]{1})([A-Z\d]{3})\d{5}$
Description
US vehicle VIN numbers for vehicles with GVW < 10k lbs
Matches
WDBCA45EXKA478654
Non-Matches
WDBCA45EXKA47865a
Author Rating: Not yet rated. Brian Bonini
Source
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Perhaps a better one...
Name: VIN_seeker
Date: 2/5/2013 5:07:56 PM
Comment:
The Check Digit is allowed to be ‘X’, so instead of [\d]{1} to match the check digit it should be [X\d]{1}. Then the entire regex becomes ([ABCDEFGHJKLMNPRSTUVWXYZ\d]{3})([ABCDEFGHJKLMNPRSTUVWXYZ\d]{5})([X\d]{1})([ABCDEFGHJKLMNPRSTUVWXYZ\d]{3})([\d]{5}). The original author had this right.


Title: Perhaps a better one...
Name: VIN_seeker
Date: 2/5/2013 12:25:23 PM
Comment:
This one: ([ABCDEFGHJKLMNPRSTUVWXYZ\d]{3})([ABCDEFGHJKLMNPRSTUVWXYZ\d]{5})([\d]{1})([ABCDEFGHJKLMNPRSTUVWXYZ\d]{3})([\d]{5}) seems to work pretty well. It parses like this: - three characters of WMI - five characters of Vehicle Attributes - a single Check Digit - Model Year, Plant Code, and the first character of the Sequential Number (which may actually be an alpha; I am not certain on that). - a five-digit Sequential Number (unambiguously numeric) I used the Wikipedia VIN article as a guide.


Title: Close, but not quite there
Name: VIN_seeker
Date: 2/5/2013 12:11:07 PM
Comment:
This regex is close, but not quite. Specifically: 1) The first three characters will match a Ford VIN, but the VDS (characters 4 through 8) is manufacturer defined and this regex is too strict. For example, 1FAHP3J24CL150479 is a valid Ford VIN for a 2012 Focus Titanium; the seventh character is 'J', and this regex expects a digit for that position. 2) Strictly speaking, the [A-Z] character classes should be [abcdefghjklmnprstuvwxyz] since VINs are not allowed to contain the letters 'i', 'o', or 'q'. 3) This regex is specifically for EU and North American VINs, not for ISO 3779 VINs. 4) There is a different VIN format for low-volume manufacturers; the last six characters might require a different regex.


Title: Does not work
Name: CCorea
Date: 7/21/2005 10:11:28 PM
Comment:
Does not read all American VINS. Ford starts with a 1 and it does not match


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials