Regex Tester
Test JavaScript regular expressions live. Highlight matches, inspect capture groups, toggle flags, and copy a ready-to-paste literal. All in your browser.
- Runs in browser
- No signup
- No tracking
How to use Regex Tester
Enter a pattern in the regex field.
Toggle flags as needed (g, i, m, s, u, y).
Paste sample text — matches highlight live.
Inspect capture groups in the side panel.
When to use it
Building input validation patterns (emails, slugs, IDs).
Extracting structured data from logs.
Search-and-replace planning before running it on real files.
Learning regex by experimenting safely.
What it fixes
Regex that 'works' until it hits an edge case in production.
Escape character confusion when copying patterns into JS strings.
Silent group-naming typos.
About Regex Tester
A regex tester is the difference between confident regex and superstition. This one uses the same engine your code does — JavaScript's `RegExp` — so what works here works in production.
Matches highlight as you type. Capture groups (numbered and named) show in a side panel. Flags toggle individually. The output gives you a copy-pastable JS literal so you don't fight escape characters when porting back to code.
References: MDN — RegExp · MDN — Regex syntax cheatsheet
Frequently asked
Which regex flavor is supported?
JavaScript's native RegExp engine — same as your browser and Node.js. Lookbehind, named groups, and Unicode property escapes work in modern browsers.
Why doesn't my PCRE regex work?
JS regex doesn't support some PCRE features: possessive quantifiers, recursion, backreferences inside lookbehind. Most patterns translate one-to-one.
What does the 'g' flag do here?
Global flag — finds all matches instead of just the first. Required to see more than one highlight.
Discussion
Related tools
All toolsJWT Decoder
Decode JWT tokens to inspect header, payload, and expiry. Decoder only — no signature verify.
Test & InspectWord Counter
Live word, character, sentence, and reading-time counter with platform limit indicators.
Test & InspectText Diff Checker
Compare two blocks of text side-by-side or unified. Ignore whitespace and case. Runs locally.
Test & Inspect