Developer Tools

Regex Tester

Test JavaScript regular expressions locally with flags, matches, capture groups, and replacement previews.

Runs locally in your browser

Regex Tester

Test JavaScript regular expressions against sample text, inspect matches and groups, and preview replacements.

Your pattern and sample text stay on this device.

What this tool does

The Regex Tester helps you check a regular expression against sample text before using it in application code, log parsing, input validation, or quick text-processing tasks. It shows every match, the index of each match, numbered capture groups, named groups, and a replacement preview.

Common use cases

  • Test a validation pattern before adding it to frontend or backend code.
  • Extract tokens from logs, URLs, stack traces, or API payloads.
  • Check whether a capture group is matching the substring you expect.
  • Preview a replacement string before running it in an editor or script.

JavaScript regex notes

This tool uses the browser’s JavaScript regex engine. That makes it useful for JavaScript and TypeScript code, but some syntax differs from Java’s java.util.regex.Pattern. If you plan to move a pattern into Java, verify Java-specific behavior separately.

Privacy note

Regex testing runs locally in the browser. Still avoid pasting secrets, private logs, tokens, or customer data into any web page unless you control the environment and understand the risk.

FAQ

Regex Tester questions

Does this Regex Tester send input to a server?

No. The pattern, sample text, match list, and replacement preview are processed locally in your browser.

Which regex flavor does this tool use?

It uses the JavaScript regular expression engine available in the browser, so syntax may differ from Java, PCRE, Python, or database regex engines.

Why is the global flag added automatically?

The tool adds the global flag when needed so it can list every match instead of only the first match.

Can I test capture groups?

Yes. Numbered capture groups and named capture groups are shown under each match when they are present.