Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
\b[(A-H|J-N|P|R-Z|0-9)]{17}\b
/
gm

Description

Every vehicle has a unique Vehicle Identification Number (VIN).

This 17 character alpha-numeric sequence and must NOT contain the letters I, O or Q (to avoid confusion with the similar looking digits). So, for example, SALVA2AE4EH877322 is valid, but SALVO2AE4EH877322 is not.

By using the \b word boundary token, we can match in quotes "SALVA2AE4EH877482", brackets (SALVA2AE4EH877998) or other boundaries that people may use <SALVA2AE4EH877002>

Submitted by anonymous - 6 years ago