Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Identity
#nhs
#uk
#health
#identity

UK NHS Number

Validates UK National Health Service (NHS) numbers: 10 digits optionally separated by spaces in groups of 3-3-4.

✓ UK healthcare portal validation✓ Patient management systems✓ NHS app onboarding forms
/
/
Safe
Test String
4 matches
\d{3}digit— \d — digit (0–9) — repeated exactly 3 times · {3} — exactly 3 times
[…]?Character class […]— Matches any single character listed in this set — repeated zero or one time (optional) · ? — zero or one time (optional)
\sspace— \s — whitespace (space, tab, newline…)
\-\-— \- — escaped character
\d{3}digit— \d — digit (0–9) — repeated exactly 3 times · {3} — exactly 3 times
[…]?Character class […]— Matches any single character listed in this set — repeated zero or one time (optional) · ? — zero or one time (optional)
\sspace— \s — whitespace (space, tab, newline…)
\-\-— \- — escaped character
\d{4}digit— \d — digit (0–9) — repeated exactly 4 times · {4} — exactly 4 times
Pattern: 29 charsInput: 49 chars
100% client-side · private

✓ Valid Examples

  • 943 476 5919
  • 9434765919
  • 943-476-5919
  • 485 777 3456

✗ Invalid Examples

  • 12345678
  • 1234567890123
  • NHS-123-456
  • abc 123 4567

Usage & Integration

Validate UK NHS Number natively in your backend or frontend without copying regex strings.

Node / Edge

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

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

Python

from regexto_validators import validate

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

Go

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

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

PHP

use RegexTo\Validators\Validator;

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

Rust

use regexto_validators::validate;

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