Skip to main content

Regex Tester

Write a regular expression, paste your test string, and see all matches highlighted in real time. Supports g, i, m, and s flags — entirely browser-side with no data sent anywhere.

FreeReal-timeg/i/m/s FlagsMatch Details
//g
Flags:

Test String

Regex syntax quick reference

  • \d — digit (0–9)
  • \w — word character (a–z, A–Z, 0–9, _)
  • \s — whitespace (space, tab, newline)
  • . — any character except newline (use s flag to include newlines)
  • ^ / $ — start / end of string (or line with m flag)
  • + — one or more; * — zero or more; ? — zero or one
  • {n,m} — between n and m repetitions
  • (?:...) — non-capturing group; (?<name>...) — named group
  • (?=...) — lookahead; (?<=...) — lookbehind

Common patterns

  • Email: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
  • URL: https?://[^\s/$.?#].[^\s]*
  • US Phone: \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
  • IPv4: (\d{1,3}\.){3}\d{1,3}
  • Date (YYYY-MM-DD): \d{4}-\d{2}-\d{2}