Friday, 10 August 2007

Regular Expression for National Insurance Number

Here is a regular expression for the UK National Insurance Number accepting values such as AB123456C etc

^[A-CEGHJ-PR-TW-Z]{1}[A-CEGHJ-NPR-TW-Z]{1}\s?[0-9]{2}\s?[0-9]{2}\s?[0-9]{2}\s?[A-DFM]{0,1}$