Regex Tester

Free · no signup · runs entirely in your browser

Open the tool →

Regex is one of those things everyone half-remembers. You know `\d+` matches digits, you know `.*` is greedy, and then you're three Stack Overflow tabs deep trying to remember what a non-capturing group looks like. This tool skips the tabs. Type a pattern, type a test string, and it tells you what matched — while you type, no button to click.

It runs JavaScript's native RegExp under the hood, so what matches here is exactly what matches in your JS code, your browser console, or a Node script. Three flag checkboxes sit next to the pattern: g (global — find every match, not just the first), i (case-insensitive), and m (multiline, so ^ and $ match line boundaries instead of just string boundaries). Toggle them and the matches update immediately.

Matches show up as a highlighted list under a live count, so you know at a glance whether your pattern caught 1 thing or 47. Write a bad pattern — unbalanced parens, a stray bracket — and it just tells you "Invalid regex" instead of a cryptic stack trace. No install, no npm package, no pasting your test data into some rando site that logs it. Everything happens in your browser tab; nothing gets uploaded anywhere.

It's built for the everyday case: sanity-checking a pattern before it goes into a validation function, figuring out why a log-parsing regex isn't catching what you expect, or just confirming that yes, that email regex you copy-pasted actually works on the address you're testing. It's not a full regex debugger with capture-group breakdowns or a railroad diagram — it's the fast version: pattern in, matches out, free forever.

How to use it

  1. Type or paste your regular expression into the PATTERN field (no need to wrap it in slashes).
  2. Check the flags you want — g for all matches, i to ignore case, m for multiline anchors — then paste your text into TEST STRING.
  3. Read the highlighted matches and the live count below; edit the pattern or text and the results update instantly.

Worked example

Pattern `[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}` with the g flag checked, tested against "contact me at [email protected] or [email protected]", returns 2 matches: [email protected] and [email protected], with the live count reading 2. Uncheck g and it stops after the first match. That's the whole workflow — no config, no account, just pattern and text.

FAQ

What regex flavor does this use?

JavaScript's native RegExp engine — the same one running in every browser and in Node.js. If a pattern matches here, it'll match the same way in your JS code.

Does it support named groups or lookbehind?

Whatever JavaScript's RegExp engine supports, this tool supports, since it's just calling `new RegExp()` under the hood. This page shows matched substrings, not individual capture groups.

Is my test data uploaded anywhere?

No. The pattern and text you type never leave your browser — there's no server round-trip, no logging, no account.

Why does it say "Invalid regex"?

Your pattern has a syntax error the engine can't parse — usually an unmatched bracket, paren, or an escape character that needs a backslash. Fix the pattern and it'll re-test automatically.

Open the Regex Tester →