Validate Drivers License numbers?

driver license number format by state
free driver license number lookup
find driver license number by ssn
can you check to see if your license is suspended
california driver license number format
check drivers license status
dmv
can i check my drivers license status online

I am working on a ACH payment processor and was wondering if I can scope the drivers license field against some rules. Any ideas on this? Can I assume numbers only or anything else more like SSN

Thanks

See ADR State License Formats (PDF).

Validate Drivers License numbers?, National Motor Vehicle License Lookup Service web site - offering a free searchable database of over 210 million U.S. driver's license photos. Search using the  Information about the generator of US SSN, Driver License (DL), State ID, Passport, and Tax ID numbers and data This tool generates information from algorithms, it does not produce actual issued documents nor facsimiles, specimen or samples of real documents.

I came up with this for a project I was working on...

function utilities() {
function validateLicense(stateCode, licenseNumber) {
    // from http://www.uiia.org/documents/license_guidelines_08.pdf
    var oneToSevenNumeric = /^[0-9]{1,7}$/;
    var oneAlpha = /(.*[A-Za-z]){1}/;
    var oneAlphaPlusSeven = /^.[0-9]{7}$/;
    var twoAlpha = /(.*[A-Za-z]){2}/;
    var alphaPlusSixNumeric = /(.*[0-9]){6}$/;
    var threeToFiveNumeric = /(.*[0-9]){3,5}$/;
    var fiveToNineNumeric = /(.*[0-9]){5,9}/;
    var sixNumeric = /^[0-9]{6}$/;
    var sevenNumeric = /^[0-9]{7}$/;
    var sevenToNineNumeric = /^[0-9]{7,9}$/;
    var eightAreNumbers = /(.*[0-9]){8}/;
    var nineNumeric = /^[0-9]{9}$/;
    var nineAlphaChars = /^[A-Za-z0-9]{9}$/;
    var tenNumeric = /^[0-9]{10}$/;
    var elevenNumeric = /^.[0-9]{11}$/;
    var twelveNumeric = /^.[0-9]{12}$/;
    var hPlusEight = /([H][0-9]{8})$/;
    var sevenPlusX = /([H][0-9]{7}X)$/;

    if (stateCode == undefined || licenseNumber == undefined) {
        return "";
    }
    if (stateCode == 'AK') {
       return validateExpression(oneToSevenNumeric, licenseNumber, "Must be 1-7 numeric");
    }
    if (stateCode == 'AL') {
      return validateExpression(sevenNumeric, licenseNumber, "Must be 7 numeric");
    }
    if (stateCode == 'AR' || stateCode == 'MS') {
      return validateExpression(nineNumeric, licenseNumber, "Must be 9 numeric");
    }
    if (stateCode == 'AZ') { 
        if (nineNumeric.test(licenseNumber) == true) {
            return "";
        }
        if (oneAlpha.test(licenseNumber) && eightAreNumbers.test(licenseNumber)) {
            return "";
        }
        if (twoAlpha.test(licenseNumber) && threeToFiveNumeric.test(licenseNumber) && licenseNumber.length < 8) {
            return "";
        }
        return "Must be 1 Alphabetic, 8 Numeric; or 2 Alphabetic, 3-6 Numeric; or 9 Numeric";
    }
    if (stateCode == 'CA') {

        if (oneAlpha.test(licenseNumber) && oneAlphaPlusSeven.test(licenseNumber)) {
            return "";
        }
        return "Must be 1 alpha and 7 numeric";
    }
    if (stateCode == 'CO' || stateCode == 'CN' || stateCode == 'CT') {
        return validateExpression(nineNumeric, licenseNumber, "Must be 9 numeric");
    }
    if (stateCode == 'DC') {
        if (sevenNumeric.test(licenseNumber) || nineNumeric.test(licenseNumber)) {
            return "";
        }
        return  "Must be 7 - 9 numeric";
    }
    if (stateCode == 'DE') {
        if (oneToSevenNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 1 - 7 numeric";
    }
    if (stateCode == 'FL') {
        if (oneAlpha.test(licenseNumber) && twelveNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 1 alpha, 12 numeric";
    }
    if (stateCode == 'GA') {
        if (sevenToNineNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 7 - 9 numeric";
    }
    if (stateCode == 'HI') {
        if (nineNumeric.test(licenseNumber) || hPlusEight.test(licenseNumber)) {
            return "";
        }
        return "Must 'H' + 8 numeric; 9 numeric";
    }
    if (stateCode == 'ID') {
        if (nineNumeric.test(licenseNumber) || sixNumeric.test(licenseNumber) || (twoAlpha.test(licenseNumber) && alphaPlusSixNumeric.test(licenseNumber))) {
            return "";
        }
        return "Must 9 numbers or 6 numbers; or 2 char, 6 numbers ";
    }

    if (stateCode == 'IL') {
        if (oneAlpha.test(licenseNumber) && elevenNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must 1 character 11 numbers";
    }
    if (stateCode == 'IN') {
        if (tenNumeric.test(licenseNumber) || nineNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 9-10 numbers";
    }
    if (stateCode == 'IA') {
        if (nineAlphaChars.test(licenseNumber) || nineNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 9 alpha numbers";
    }
    if (stateCode == 'KS' || stateCode == 'KY') {
        if (nineNumeric.test(licenseNumber) || (oneAlpha.test(licenseNumber) && eightAreNumbers.test(licenseNumber) && licenseNumber.length == 9)) {
            return "";
        }
        return "Must be 1 alpha and 8 numeric";
    }
    if (stateCode == 'LA') {
        if (nineNumeric.test(licenseNumber) == true) {
            return "";
        }
        return "Must be 9 numeric";
    }
    if (stateCode == 'ME') {
        if (sevenNumeric.test(licenseNumber) || sevenPlusX.test(licenseNumber)) {
            return "";
        }
        return "Must be 7 numeric";
    }
    if (stateCode == 'MD' || stateCode == 'MI' || stateCode == 'MN') {
        if (oneAlpha.test(licenseNumber) && twelveNumeric.test(licenseNumber)) {
            return "";
        }
        return "1 Alphabetic, 12 Numeric";
    }
    if (stateCode == 'MA') {
        if ((oneAlpha.test(licenseNumber) && eightAreNumbers.test(licenseNumber) && licenseNumber.length == 9) || nineNumeric.test(licenseNumber)) {
            return "";
        }
        return "Must be 1 alpha, 8 numeric; 9 numeric";
    }

    if (stateCode == 'MO') {
        if ((oneAlpha.test(licenseNumber) && fiveToNineNumeric.test(licenseNumber) && licenseNumber.length < 11) || nineNumeric.test(licenseNumber)) {
            return "";
        }
        return "1 alpha - 5-9 Numeric or 9 numeric";
    }
    return "";
}

function validateExpression(expression, value, error) {
    if (expression.test(value) == true) {
        return "";
    }
    return error;
}

return {
    validateLicense: validateLicense,
    validateExpression: validateExpression
};

}

US Driver's License Numbers, Is the driver license number the same as the ID number? E-Verify is able to verify the validity of driver’s license and ID card information by matching the data from Form I-9 entered by employers against records available to U.S. Department of Homeland Security.

Assuming your in the USA each state has different formats for their driver license numbers so as far I know you would have validations on a state wide basis. This site should get you started w/ validation by driver's license number:

http://www.highprogrammer.com/alan/numbers/index.html

Drivers License Lookup, What do the numbers mean on your Florida driver's license? Assuming your in the USA each state has different formats for their driver license numbers so as far I know you would have validations on a state wide basis. This site should get you started w/ validation by driver's license number:

How to Check the Status of a Driver's License, represent the consonants of the surname. -- 222 represents the first name and middle initial. Check the status of your driver's license, ID card, registration, license plate, title, or handicap placard.

Is everyone's drivers license number the same as their identification , What does the letter in your driver's license number mean? The Alabama Department of Revenue has launched ALVerify for the sole purpose of permitting license plate issuing officials to determine whether an Alabama driver license or non-driver identification card is valid pursuant to the provisions of Act 2011-688, commonly referred to as the “Online Insurance Verification System Act.”

driver's license number is actually a secret code florida pays $1000 , And while E-Verify can validate social security numbers in the course of performing a verification, the system has historically ignored driver's  Validate RN and LPN licenses by entering the 7-digit license number or search by name. Validate provisional licenses by entering the 8-digit provisional license number or search by name. Questions can be emailed to KBN-cred@ky.gov. Validate temporary work permits by entering the 5-digit temporary work permit number or search by name.

Comments
  • Certain key bits of info are missing - In which country? If in the US, in which state(s)? In the US DL#s seem to vary a lot state by state.
  • I would only do this if I had to. I don't know anything about US and Canadian drivers license numbering schemes, but I would expect any or all of them to be subject to occasional change. You might be headed for a maintenance headache.
  • Haha, I would love to see anyone attempting that regex. Looks even worse then e-mail validation.
  • @Anders, you mean those 50 or so regexes, right? To do a meaningful validation you'd have to have a separate pattern per numbering scheme, and to match the pattern to the issuer.
  • @John M Gant, referring to ex-parrot.com/pdw/Mail-RFC822-Address.html , and yeah of course.
  • Note that this list does not seem to cover all US drivers' licenses -- I don't see the federal government in that list, but it also issues licenses.
  • Something like this: ntsi.com/drivers-lic (although, does not seem right)?