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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find UK Driver License
Expression
[A-Z0-9]{5}\d[0156]\d([0][1-9]|[12]\d|3[01])\d[A-Z0-9]{3}[A-Z]{2}
Description
Matches the UK Drivers License format as laid down by the DVLA / dvla. See http://www.govtalk.gov.uk/gdsc/html/frames/default.htm Matches: 1. Must be 16 characters 2. First 5 characters are alphanumeric. 3. Next 6 characters must be numeric 4. Next 3 characters are alphanumeric 5. Last 2 characters are alpha 6. Second character of numeric section can only be 0, 1, 5 or 6. 7. Fourth and fifth characters of numeric section must be in the range 01 to 31.
Matches
JOHNS711215GG9SY
Non-Matches
JOHNS731215GG9SY
Author Rating: Not yet rated. Stephen Jones
Source DVLA
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: Short name padding with 9s
Name: Romek
Date: 9/29/2014 5:50:15 AM
Comment:
According to rules every Mac is shortened to MC. If the surname is shorter than 5 characters, then not existing letters are replaced with digits "9". So "Ben" will be "BEN99"


Title: Surnames
Name: Moray Macdonald
Date: 4/2/2013 6:07:23 AM
Comment:
The first 5 letters are not always the first 5 letters of the driver's surname. All the Macdonalds I know (including those I'm not related to) have "MCDON" at the beginning instead of "MACDO". I can only assume it's the same for surnames like Mac/McDougall etc.


Title: Numeric section
Name: Chris
Date: 1/2/2008 7:47:32 AM
Comment:
Excellent pattern. Should the middle section be this instead?: \d[0-9]\d[0156]\d[0-9]\d([0][1-9]|[12]\d|3[01])\d[0-9]


Title: Couple of issues
Name: Helpful person
Date: 9/20/2007 12:04:40 PM
Comment:
First five should be: [A-Z][A-Z9]{4} Last five should be: [A-Z9][A-Z9][6-9][A-Z][A-Z] First initial, or 9 if no forenames Second initial or 9 if no middle name Tiebreaker digit. First issued is 9, then 8,7 as required. (New numbers are issued for coincidental name/DOB matches, accidental duplicate records, and ID theft.) Last two digits are checksum.


Title: First Five Characters
Name: Stephen Jones
Date: 11/10/2006 9:52:49 AM
Comment:
Bill, The DEVLA 9 pad the empty positions. For example if my surname was TIMS it'd be TIMS9


Title: First Five Characters
Name: Bill Steamshovel
Date: 11/8/2006 9:47:56 PM
Comment:
I understand that the five characters are the first five letters of the driver's surname. How are characters assigned if the surname is shorter than five letters?


Title: catogaries on driving liscence
Name: Stephen Jones
Date: 7/13/2006 11:13:34 AM
Comment:
Those catagories are nothing to do with the license format. They are merely the classes of vehicles you are allowed to drive.


Title: catogaries on driving liscence
Name: elaine armstrong
Date: 7/12/2006 12:58:18 PM
Comment:
please could you tell me what the catogaries B B1 F K P are on my driving liscence thank you


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