Regex Tester

Test regular expressions with real-time matching. Supports capture groups, flags, and JavaScript regex syntax.

/ /
Test String
Matches
Enter a test string to see matches
No matches found
Enter a regex pattern above
Regex Quick Reference
Character Classes
  • \d - digit [0-9]
  • \w - word [a-zA-Z0-9_]
  • \s - whitespace
  • . - any character
Quantifiers
  • * - 0 or more
  • + - 1 or more
  • ? - 0 or 1
  • {n} - exactly n
  • {n,m} - n to m
Anchors
  • ^ - start of string
  • $ - end of string
  • \b - word boundary
Groups
  • (...) - capture group
  • (?:...) - non-capture
  • (?=...) - lookahead
  • (?<=...) - lookbehind
  • | - alternation

How to Use

  1. Enter a regex pattern in the top field. Toggle flags (g, i, m, s) as needed.
  2. Paste your test text in the left box.
  3. View matches instantly on the right, including capture groups.

Common Scenarios

  • Validating email addresses, phone numbers, or URLs
  • Extracting data from logs or structured text
  • Testing regex before using it in JavaScript, Python, or Java