Regex Tester and Debugger

Live match highlighting, capture groups, replace preview and per-line testing. Nothing leaves your browser.

Stays on your device. This tool runs in your browser — nothing you paste or open ever leaves it. Nothing uploaded, nothing to leak.

Pattern
/ /
Test string
Replace
Regex quick reference
. any character
\d \w \s digit, word, space
\D \W \S negated classes
[abc] [^abc] set / not in set
^ $ start / end
\b word boundary
* + ? 0+, 1+, optional
{2} {2,} {2,5} counts
(…) capture group
(?<name>…) named group
(?:…) non-capture
a|b alternation
(?=…) (?!…) look-ahead
(?<=…) (?<!…) look-behind
Run the tool first — there’s no result to send yet.

How to test a regular expression

Type your pattern in the top box and your test text below it — matches highlight instantly. Toggle flags like global (g), ignore-case (i) and multiline (m) as pills. Open Replace to preview a substitution using $1, $2 or named-group references, and switch on "Test each line" to check many strings at once.

Regex Tester — TechWhack Score

9.8/10
  • Privacy 10/10

    Your pattern and test text stay in the browser — nothing is uploaded.

  • Speed 10/10

    Highlights matches live as you type.

  • Features 9/10

    Real-time match highlighting, a capture-group table, a find-and-replace preview, and per-line testing to see which inputs pass.

  • Free 10/10

    No sign-up or account needed for any feature.

Verdict: Live highlighting, a capture-group breakdown and per-line testing — the working parts of regex101 without the account.

Help us improve Was this tool useful? Tap a star. Thanks — your rating helps others find it.
Be the first to rate
Embed this tool on your site
<iframe src="https://techwhack.com/tools/dev/regex-tester/embed" width="100%" height="440" frameborder="0" loading="lazy"></iframe> <!-- Powered by TechWhack -->
A regex tester lets you write a regular expression and see exactly what it matches in your test text, in real time. TechWhack highlights every match as you type, breaks out each capture group in a table, previews your find-and-replace, and can test each line separately so you can see which inputs pass — all in your browser, so your data is never uploaded.

Why your pattern might not match

Most surprises come from flags and escaping. Without the global flag you only get the first match; without multiline, ^ and $ anchor to the whole string, not each line. Escape special characters (dot, star, plus, question mark) with a backslash when you mean them literally. The capture-groups table shows exactly what each set of parentheses captured, so you can see where a pattern drifts.

FAQ

What is the difference between greedy and lazy matching?A greedy quantifier like .+ grabs as much text as possible and backtracks, so it can swallow more than you intend; adding a question mark makes it lazy (.+?) so it matches as little as possible. Use lazy matching when you want to stop at the first delimiter, like extracting one quoted string.
What do the regex flags g, i, and m do?The g flag finds all matches instead of stopping at the first, i makes matching case-insensitive, and m makes the anchors ^ and $ match at the start and end of each line. You can toggle the flags and see the effect on matches live.
Which regex flavor does this tester use?It uses the JavaScript regex flavor, so syntax like named groups, lookahead, and flags behaves as it would in a browser or Node. Patterns that rely on features specific to other engines, such as some lookbehind or possessive quantifiers, may differ.
How do I see what each capture group matched?Matches are highlighted live and a capture-group table breaks out what each parenthesized group caught, with a replace preview to test substitutions. You can also test line by line, which helps when a pattern should match per row.
Is my pattern or test text uploaded anywhere?No. The matching runs in your browser, so your regular expression and sample text never leave your device. You can test against real log lines or data safely.