Regex Tester
Last updated: June 1, 2026Build and test regular expressions live.
This regex tester lets you build and test JavaScript (ECMAScript) regular expressions against your own text, with live match highlighting, flag toggles (g, i, m, s, u) and a match count. Type a pattern and matches light up instantly as you go — the fast way to learn, build and debug regex. It runs entirely in your browser, so your patterns and text stay on your device.
How to use Regex Tester
The Regex Tester lets you build and test JavaScript regular expressions against your own text, with live match highlighting, flag toggles (g, i, m, s, u) and a match count. It's the fast way to learn and debug regex — runs entirely in your browser.
- 1Type your regular expression.
- 2Toggle flags like g (global) and i (ignore case).
- 3Paste your test string and watch matches highlight live.
Live highlighting
Matches are highlighted in your text as you type the pattern.
Flag toggles
Switch g, i, m, s and u on and off to see their effect instantly.
Private
Your patterns and text stay on your device.
Test a regex against sample text
Paste your test string, type a pattern and watch every match highlight live with a running match count — so you can confirm a pattern works before dropping it into your code.
Test JavaScript regex
Patterns run on the same ECMAScript engine your browser and Node.js use, so what matches here matches in your JS code. Toggle the g, i, m, s and u flags to see exactly how each changes the result.
Debug a pattern that isn't matching
See invalid-pattern errors immediately and check escaping and flags against live text. A quick way to find why a regex is over- or under-matching.
Learn and build regular expressions
Experiment with character classes, quantifiers, groups and anchors and get instant visual feedback — an interactive way to learn regex without leaving the page.
Regex Tester — frequently asked questions
What regex flavor does this use?
JavaScript (ECMAScript) regular expressions — the same engine browsers and Node.js use.
What do the flags mean?
g matches all occurrences, i ignores case, m makes ^/$ match per line, s lets . match newlines, and u enables full Unicode.
Why isn't my pattern matching?
Check escaping (backslashes), and remember special characters like . + * ? need escaping to be literal. The tool shows an error for invalid patterns.
Is it free?
Yes, completely free.
Share this tool
Send it to someone who needs it or save the link for later.