I have the following regular expression which validates the British National Insurance Number
^([a-zA-Z]){2}( )?([0-9]){2}( )?([0-9]){2}( )?([0-9]){2}( )?([
"(^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)[A-Z&&[^DFIQUV]][A-Z&&[^DFIOQUV]][0-9]{6}[A-D ]$)"
Nino Validator meets all the following criteria.
Actually, NIN doesn't allow D, F, I, Q, U or V for the first two letters and doesn't allow O for the second letter; on top of this, the prefix letters can not be BG, GB, NK, KN, TN, NT and ZZ. Also the suffix letter is either A, B, C or D, but may be represented by a space if unknown. - http://en.wikipedia.org/wiki/National_Insurance_number#Format
As such, a more valid check would be (I have only supplied a version with capital letters, can easily be altered for lower-case):
^(?!BG)(?!GB)(?!NK)(?!KN)(?!TN)(?!NT)(?!ZZ)(?:[A-CEGHJ-PR-TW-Z][A-CEGHJ-NPR-TW-Z])(?:\s*\d\s*){6}([A-D]|\s)$