Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Identity
en-GB
#nino
#uk
#national-insurance
#identity

UK National Insurance Number (NINO)

Matches a UK National Insurance Number in the format AA 99 99 99 A.

✓ UK employment forms✓ Tax credit applications✓ NHS registration
/
/
Safe
Test String
2 matches
[…]{2}Character class […]— Matches any single character listed in this set — repeated exactly 2 times · {2} — exactly 2 times
A-CA-C— A-C — range from 'A' to 'C'
EE— 'E' — literal character
GG— 'G' — literal character
HH— 'H' — literal character
J-PJ-P— J-P — range from 'J' to 'P'
R-TR-T— R-T — range from 'R' to 'T'
W-ZW-Z— W-Z — range from 'W' to 'Z'
\s?space— \s — whitespace (space, tab, newline…) — repeated zero or one time (optional) · ? — zero or one time (optional)
\d{2}digit— \d — digit (0–9) — repeated exactly 2 times · {2} — exactly 2 times
\s?space— \s — whitespace (space, tab, newline…) — repeated zero or one time (optional) · ? — zero or one time (optional)
\d{2}digit— \d — digit (0–9) — repeated exactly 2 times · {2} — exactly 2 times
\s?space— \s — whitespace (space, tab, newline…) — repeated zero or one time (optional) · ? — zero or one time (optional)
\d{2}digit— \d — digit (0–9) — repeated exactly 2 times · {2} — exactly 2 times
\s?space— \s — whitespace (space, tab, newline…) — repeated zero or one time (optional) · ? — zero or one time (optional)
[…]Character class […]— Matches any single character listed in this set
A-DA-D— A-D — range from 'A' to 'D'
Pattern: 52 charsInput: 37 chars
100% client-side · private

✓ Valid Examples

  • AB 12 34 56 A
  • AB123456A
  • QQ 12 34 56 C

✗ Invalid Examples

  • DA 12 34 56 A
  • AB 12 34 56 E
  • 12 34 56 78 A

Usage & Integration

Validate UK National Insurance Number (NINO) natively in your backend or frontend without copying regex strings.

Node / Edge

import { validate } from '@regexto/validators';

validate('uk-nino', '...');

Python

from regexto_validators import validate

validate("uk-nino", "...")

Go

import "github.com/regex-to/validators-go"

valid, err := validators.Validate("uk-nino", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('uk-nino', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("uk-nino", "...").unwrap();