Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Identity
#passport
#us
#usa
#identity

US Passport Number

Validates United States passport numbers: 9 alphanumeric characters starting with 1-2 letters followed by digits.

✓ Travel booking form validation✓ KYC onboarding flows✓ Document verification systems
/
/
Safe
Test String
4 matches
[…]{1,2}Character class […]— Matches any single character listed in this set — repeated between 1 and 2 times · {1,2} — between 1 and 2 times
A-ZA-Z— A-Z — range from 'A' to 'Z'
[…]{7,8}Character class […]— Matches any single character listed in this set — repeated between 7 and 8 times · {7,8} — between 7 and 8 times
0-90-9— 0-9 — range from '0' to '9'
Pattern: 20 charsInput: 39 chars
100% client-side · private

✓ Valid Examples

  • A12345678
  • B98765432
  • AB1234567
  • C00000001

✗ Invalid Examples

  • 123456789
  • ABCDEFGHI
  • A1234567
  • ABC123456

Usage & Integration

Validate US Passport Number natively in your backend or frontend without copying regex strings.

Node / Edge

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

validate('us-passport', '...');

Python

from regexto_validators import validate

validate("us-passport", "...")

Go

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

valid, err := validators.Validate("us-passport", "...")

PHP

use RegexTo\Validators\Validator;

Validator::validate('us-passport', '...');

Rust

use regexto_validators::validate;

let is_valid = validate("us-passport", "...").unwrap();