Ask or search…
K
Comment on page

ID Number Regex

Validate the ID number format to prevent failed ID lookups due to invalid format
The most common reason for failure of an ID lookup is because the end user did not input their ID number correctly. One of the best ways to mitigate this is to validate ID numbers on the client-side, before sending them to Smile ID. Below we will provide validation regexes for most of our ID types. It is important to note that they change over time, and we will do our best to keep this page updated.

Know Your Customer (KYC)

Country
Country Code
id_type
Regex
🇬🇭
Ghana
GH
DRIVERS_LICENSE
/^[a-zA-Z0-9!-]{6,18}$/i
Ghana
GH
PASSPORT
/^[A-Z][0-9]{7,9}$/i
Ghana
GH
SSNIT
/^[a-zA-Z]{1}[a-zA-Z0-9]{12,14}$/i
Ghana
GH
VOTER_ID
/^[0-9]{10,12}$/
Ghana
GH
NEW_VOTER___ID
/^[0-9]{10,12}$/
🇰🇪
Kenya
KE
ALIEN_CARD
/^[0-9]{6,9}$/
Kenya
KE
DRIVERS_LICENSE
/^[0-9]{1,9}$/
Kenya
KE
KRA_PIN
/^[0-9]{1,9}$/
Kenya
KE
NATIONAL_ID
/^[0-9]{1,9}$/
Kenya
KE
NATIONAL_ID_NO_PHOTO
/^[0-9]{1,9}$/
Kenya
KE
PASSPORT
/^[A-Z0-9]{7,9}$/
🇳🇬
Nigeria
NG
BANK_ACCOUNT
/^[0-9]{10}$/
Nigeria
NG
BVN
/^[0-9]{11}$/
Nigeria
NG
NIN_V2 *
/^[0-9]{11}$/
Nigeria
NG
NIN_SLIP **
/^[0-9]{11}$/
Nigeria
NG
DRIVERS_LICENSE
/^[a-zA-Z]{3}([ -]{1})?[A-Z0-9]{6,12}$/i
Nigeria
NG
PHONE_NUMBER
/^[0-9]{11}$/
Nigeria
NG
VOTER_ID
/^(INC[A-Za-z0-9]{17}|[A-Za-z0-9]{19,20})$/
🇿🇦
South Africa
ZA
NATIONAL_ID
/^[0-9]{13}$/
South Africa
ZA
NATIONAL_ID_NO_PHOTO
/^[0-9]{13}$/
🇺🇬
Uganda
UG
NATIONAL_ID_NO_PHOTO
/^[A-Z0-9]{14}$/i
*: Tokenized version of the NIN
**: Returns the NIN Slip for document-less verification