A regular expression to match and valid Vehicle Registration Numbers in the UK.
/^([A-Z]{3}\s?(\d{3}|\d{2}|d{1})\s?[A-Z])|([A-Z]\s?(\d{3}|\d{2}|\d{1})\s?[A-Z]{3})|(([A-HK-PRSVWY][A-HJ-PR-Y])\s?([0][2-9]|[1-9][0-9])\s?[A-HJ-PR-Z]{3})$/
Matches:
- BD51 SMR
- BDE 123 R
- BD 12 ABC
Non-matches:
- AB 123 C
- A 123 BC
- AB 12 CD
See Also:
- Regex To Validate Telephone Number In UK
- UK National Insurance Number (NIN) Regular Expression
- UK Bank Sort Code Regular Expression
- Regular Expression To Match US/UK/CA Zip (Postal) Codes
Rate This Regex
User Review
( votes)Expression Flags
Flags | Description |
---|---|
i |
Ignore case sensitive. |
g |
Allows global search. |
m |
Allows multiline search. |