Regular Expression To Valid UK Vehicle Registration Numbers

Category: Strings

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:

Rate This Regex
Sending
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.