No upload, 100% local, no account

Regex Tester

Enter a pattern, choose flags, and test against your text. Matches are highlighted inline. Capture groups are listed per match. Nothing leaves your browser.

How Regex Tester works

The regex tester lets you write a JavaScript regular expression, paste sample text, and see every match highlighted in real time. Capture groups appear in a table below the text so you can inspect what each group captured without running a script. Supported flags are g (global), i (case-insensitive), m (multiline), s (dotAll), u (Unicode) and y (sticky). Nothing you type leaves your device: the matching engine is the JavaScript runtime built into your browser tab, not a server.

Under the hood, the tool calls the standard ECMAScript RegExp constructor with the pattern and flags you provide, then uses the string matchAll iterator to collect all Match objects. The groups table is built directly from those objects, so what you see is exactly what Node.js or a browser would return in production code, with no intermediate translation layer.

How to use Regex Tester, step by step

  1. Type or paste your regular expression into the pattern field.
  2. Toggle the flags you need (g, i, m, s, u, y) using the checkboxes.
  3. Paste the text you want to test into the sample area.
  4. Inspect the highlighted matches in the text and the capture-group table below.
  5. Adjust the pattern and watch results update live.

Common use cases

  • Validate that an email-extraction pattern correctly handles edge cases like plus-addressing before committing it to a data pipeline.
  • Debug a named capture group for parsing log lines, checking each group value against a real log sample.
  • Confirm that a URL-matching regex with the u flag handles Unicode domain names correctly before adding it to a router.
  • Test a search-and-replace pattern interactively to verify it does not have unintended greedy matches in a large config file.

Frequently asked questions

Does anything I type get sent to a server?

No. The matching runs entirely inside this browser tab using the built-in JavaScript RegExp engine. Your pattern, flags and sample text are never transmitted anywhere. Open DevTools and check the Network tab while you type: zero requests go out.

Which regex flavour does this tester use?

ECMAScript (ES2022+) as implemented by your browser. This is the same flavour used in Node.js, Deno and modern browsers. PCRE-only features such as lookbehind of variable length or possessive quantifiers are not supported, though most common patterns work identically.

Why do I get an error about an invalid regular expression?

The browser's RegExp constructor throws a SyntaxError for patterns that are not valid ECMAScript regex. Common causes include an unescaped backslash, an unclosed group, or a Unicode property escape (\p{...}) used without the u flag.

What does the capture-group table show?

For every match found (subject to the g flag), the table shows the full match and then each numbered or named group in order. Named groups appear with their name as the column header. Groups that did not participate in a match show as empty.

Can I test patterns that use lookbehind?

Yes, as long as the lookbehind is a fixed-length or variable-length lookbehind that your browser supports. Chrome and Firefox have supported variable-length lookbehinds since 2020. Safari added support in 2022. If your browser is recent, it should work.

Does the tester work if I go offline mid-session?

Yes. After the page loads, every match is computed locally by your browser's JavaScript engine with no network dependency. Cutting your connection does not interrupt testing.