Developer Tools

Regex Tester & Debugger

Write a regex pattern, paste your test string, and see all matches highlighted in real time. Capture groups are listed with their values, flags like g, i, m are toggleable, and match details show position and length.

Live match highlighting All JS flags supported Browser-only
/ /
Test string
Matches

Enter a pattern and test string to see matches

Regex testing runs entirely in your browser

Features

  • Real-time highlighting of all matches in the test string
  • Shows match index, position, and length for each match
  • Lists all capture group values per match
  • Toggleable flags: global, case-insensitive, multiline, dotAll
  • Regex reference cheatsheet built in
  • Displays total match count and no-match warning

How to use it

  1. Enter your regex pattern in the pattern field (without slashes).
  2. Select the flags you need (g, i, m).
  3. Paste your test string in the text area.
  4. Matches are highlighted instantly; capture groups appear in the table below.

Use cases

  • Debugging regex patterns for form validation
  • Testing log parsing patterns before adding to code
  • Learning regex by seeing which parts match
  • Building extract patterns for data cleaning pipelines

Limitations

  • Invalid regex patterns are caught and reported without running the test.
  • Very large input can be slower on older devices.
  • This utility is designed for common snippets and local inspection, not as a full security or language-specific validator.
Questions & answers

Frequently asked

Why do I get an 'Invalid regular expression' error?

Certain characters like (, ), [, ], {, }, +, *, ?, ^, $, |, and \ are special and must be escaped with a backslash if you want to match them literally.

Does it support lookaheads and lookbehinds?

Yes, modern JavaScript regex supports positive/negative lookaheads (?=...) and lookbehinds (?<=...) in all modern browsers.