Regex Tester, Matcher & Diagram — Free
Runs 100% in your browser — your files never leave your device.
Regular expressions are easier to debug when matches, capture ranges, and structure are visible together. Enter a JavaScript pattern, flags, and test text to inspect every match and group, generate sample matching text, or load an SVG railroad-style diagram only when requested.
How it works
- 1
Enter a pattern and flags
- 2
Paste test text and inspect matches
- 3
Generate an example or render the diagram
About this tool
How testing works here
Enter a pattern and a test string; the tool highlights every match live as you type, with match positions and capture groups broken out. The regex executes in your browser against your text — nothing is sent anywhere, which matters when the string is production data.
Test both directions
A pattern proven only on matching input is untested. Feed it lines that should NOT match, boundary cases (empty string, single character, special characters), and near-misses. The tester makes negative testing cheap — five minutes here saves a production regex incident.
Reading the groups
Capture groups appear numbered with their captured content, so complex patterns stop being guesses. Untested capture groups are where regex bugs hide: a group that captures empty instead of null, or a nested group with a shifted number, is visible here instantly.
Frequently asked questions
Which regex flavor does it use?
JavaScript (ECMAScript) regex — the syntax and flags match what runs in browsers and Node. Other languages differ on lookbehind and unicode handling.
Why does my pattern match nothing when it clearly should?
Check the flags (case sensitivity, multiline) and anchor usage — ^ and $ anchor to string or line depending on the multiline flag. The highlight shows what the engine actually sees.
Can catastrophic backtracking hurt the page?
Yes — nested quantifiers on ambiguous patterns can freeze the tab. That failure is itself a finding: the pattern is unsafe for production input too.