Regular Expressions 101

Community Patterns

National Insurance Number regular expression

3

Regular Expression
PCRE2 (PHP >=7.3)

/
^(?!BG|GB|KN|NK|NT|TN|ZZ)[^DFIQUV][^DFIQUVo][0-9]{6}[ABCD]$
/
img

Description

This regular expression is build from the description of NINO number of GOV.UK,

Submitted by Iftakhar Husan - 3 years ago