🧑‍💻

Regex Tester

🔒 In your browser

Test regular expressions with live match highlighting.

2 match(es)

  • "a@b.com" @ 8
  • "c@d.org" @ 19

About the Regex Tester

Regular expressions are powerful but hard to get right. This free regex tester lets you build and debug patterns with live match highlighting, capture groups and flags, so you can see exactly what your expression matches before using it in code.

It runs in your browser and your test data stays private.

How to test a regular expression

  • Enter your pattern and choose flags (global, case-insensitive, multiline).
  • Paste sample text to see matches highlighted live.
  • Inspect capture groups for each match.

Regex building blocks

  • \d, \w, \s — a digit, word character, or whitespace.
  • + * ? — one-or-more, zero-or-more, optional.
  • [a-z] and [^...] — a character set, or its negation.
  • ( ) — a capture group you can reference later.
  • ^ and $ — the start and end of a line or string.

Frequently asked questions

What is a regex tester?

A tool that runs a regular expression against sample text and highlights the matches and capture groups in real time, so you can refine the pattern interactively.

Which regex flavour does it use?

It uses JavaScript regular expressions, which are also very close to those in many other languages for common patterns.

Is my test data uploaded?

No. Matching happens entirely in your browser.

What are capture groups?

Parentheses in a pattern capture the matched text so you can reuse it — for example to extract the two halves of a date, or to reference them in a replacement as $1, $2. This tester shows each group's value per match.

What's the difference between greedy and lazy matching?

Quantifiers like + and * are greedy by default — they match as much as possible. Adding ? makes them lazy (+?, *?), matching as little as possible, which matters when a pattern could match several lengths.

Related searches

regex testerregular expression testertest regex onlineregexpregex debuggerregex matchregex101 alternative

Related Developer tools

🔗 Embed this tool on your website — free

Copy this and paste it into your page's HTML. The tool runs in the visitor's browser, just like here. Change height to fit, or add the optional auto-resize snippet below. Add ?theme=dark to the URL for dark mode.

<iframe src="https://toolhq.dev/embed/regex-tester/" title="Regex Tester — ToolsHub" width="100%" height="520" style="border:1px solid #e5e7eb;border-radius:12px;max-width:680px" loading="lazy"></iframe>
Optional: auto-resize the iframe height

Add this once on the same page so the iframe grows to fit the tool:

<script>
addEventListener("message", function (e) {
  if (e.data && e.data.type === "toolshub:resize") {
    document.querySelectorAll('iframe[src*="/embed/"]').forEach(function (f) {
      if (f.contentWindow === e.source) f.style.height = e.data.height + "px";
    });
  }
});
</script>