NNonkera

Regex Tester

Developer Tools

Test a regular expression against sample text, with live-highlighted matches and capture groups — computed locally in your browser.

Written without the surrounding slashes.

Contact us at hello@nonkera.com or support@nonkera.com.
#1hello@nonkera.comat index 14
#2support@nonkera.comat index 35

Why test a regex instead of just writing it

Regular expressions are compact but unforgiving — a single misplaced character can silently change what a pattern matches, without throwing any error to tell you something's wrong. Testing a pattern against real sample text before dropping it into production code (a form validator, a search-and-replace, a log parser) catches both false negatives (text that should match but doesn't) and false positives (text that matches when it shouldn't) before they become a live bug.

Reading the highlighted matches

Matches are highlighted directly in your test text as you type, so you can see at a glance whether the pattern is catching what you expect — too few highlights usually means the pattern is too strict, while unexpectedly broad highlighting usually means it's too permissive. Each match is also listed individually below with its position in the text and any captured groups, which is useful for confirming that parenthesized parts of your pattern (like extracting just the domain from an email match) are capturing exactly the substring you intend.

What the common flags actually change

The g (global) flag finds every match in the text instead of stopping after the first one — almost always what you want when testing, since it shows the full picture of what a pattern catches. The i (case-insensitive) flag makes letter casing irrelevant to matching. The m (multiline) flag changes how ^ and $ behave, making them match the start and end of each line rather than only the very start and end of the whole string — important for patterns applied to multi-line text. The s (dot-matches-newline) flag changes the . wildcard to also match line breaks, which it doesn't by default.

A note on regex complexity

It's worth resisting the urge to write an overly clever, all-in-one pattern for something like full email or URL validation — genuinely correct patterns for those get extremely long and hard to maintain, and in practice a simpler, slightly looser pattern combined with an actual validation step (like attempting to parse a URL, or sending a confirmation email) is usually more robust than chasing a perfect regex. Regex is at its best for well-defined, bounded patterns — extracting a specific format, validating a simple structure — not as a general-purpose parser for anything with real structural complexity.

How to use Regex Tester

  1. 1Enter a regular expression pattern and choose your flags.
  2. 2Paste or type test text.
  3. 3Review the highlighted matches and capture groups.

Frequently asked questions

Why do I need the global (g) flag?

Without it, a regex stops after the first match. Testing almost always benefits from seeing every match in the text, which is why this tool scans globally by default regardless of the flag toggle for highlighting purposes.

What's the difference between m and s flags?

The m (multiline) flag changes how ^ and $ anchor to line boundaries instead of the whole string. The s (dot-all) flag changes . to also match newline characters, which it doesn't by default.

Is my test text or pattern sent anywhere?

No — matching runs entirely in your browser's built-in regular expression engine.

Why does my pattern show an error?

Usually an unescaped special character or an unclosed group/bracket — the error message shown comes directly from the browser's regex engine and typically points at the specific syntax issue.

Can I test capture groups, not just whether something matches?

Yes — any parenthesized group in your pattern is listed separately for each match, so you can confirm it's capturing exactly the substring you expect.