Skip to main content

Regex Roulette · #55 · 2026-05-29

Match US phone numbers (xxx-xxx-xxxx)

Difficulty 1/3

How to play

Write a regex that matches all green strings and rejects all red strings. Live feedback shows which strings pass. Shorter patterns score better.

Must match

  • 555-123-4567 — not yet evaluated
  • 800-555-0100 — not yet evaluated
  • 212-867-5309 — not yet evaluated

Must not match

  • 5551234567 — not yet evaluated
  • 555-12-4567 — not yet evaluated
  • 55-123-4567 — not yet evaluated
  • abc-def-ghij — not yet evaluated

Loading your progress...

Pattern body only — slashes and flags (e.g. /g, /i) aren't part of the input.

0/200 chars

Type a regex that matches all green strings and rejects all red strings · Back to hub