Launching a SaaS?·Collect waitlist signups before you build — before.run
SandboxPatternsDetectDocsChangelog
Phone
en-US
#phone
#us
#american
#mobile

Phone — US

Matches a US phone number in various formats: (555) 867-5309, 555-867-5309, 5558675309, or with +1 country code.

US contact formsCustomer registrationAddress books
/
/
Risk
Test String
4 matches
(…)?Group #1Capturing group — captures matched text for reuse or extraction — repeated zero or one time (optional) · ? — zero or one time (optional)
\+\+\+ — escaped character '+'
11'1' — literal character
[…]?Character class […]Matches any single character listed in this set — repeated zero or one time (optional) · ? — zero or one time (optional)
\(?\(\( — escaped character '(' — repeated zero or one time (optional) · ? — zero or one time (optional)
\d{3}digit\d — digit (0–9) — repeated exactly 3 times · {3} — exactly 3 times
\)?\)\) — escaped character ')' — repeated zero or one time (optional) · ? — zero or one time (optional)
[…]?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: 48 charsInput: 54 chars
100% client-side · private

Valid Examples

  • (555) 867-5309
  • 555-867-5309
  • +1 555 867 5309
  • 5558675309

Invalid Examples

  • +44 20 7183 8750
  • 123-456-789
  • 555-867-530

Usage & Integration

Validate Phone — US natively in your backend or frontend without copying regex strings.

Node / Edge

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

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

Python

from regexto_validators import validate

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

Go

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

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

PHP

use RegexTo\Validators\Validator;

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

Rust

use regexto_validators::validate;

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