Skip to content

Free tool

Regex Tester

Write a pattern, see matches highlighted as you type, inspect capture groups and preview a replacement.

Runs entirely in your browser. Nothing you enter is sent to a server.

Flags

Highlighted matches

Matches and groups

#IndexMatchGroups

Replace preview

How it works

The tool builds a RegExp from your pattern and flags and runs it against your text, listing each match with its position and capture groups (including named groups). The replace preview uses String.prototype.replace, so $1, $& and $<name> work as in JavaScript.

Matching runs synchronously on the page. To limit the risk of a runaway pattern, input is capped at 20,000 characters, patterns at 500 characters and results at 1,000 matches, and patterns with nested quantifiers ask for confirmation first. These are safeguards, not guarantees.

Common uses

  • Building and debugging validation patterns for forms.
  • Extracting parts of log lines or text with capture groups.
  • Previewing a find-and-replace before running it on real data.
  • Learning how regex flags and groups behave.

Frequently asked questions

Which regex flavour does this use?

The JavaScript (ECMAScript) engine built into your browser. Other languages such as Python, PCRE or .NET differ in details like lookbehind support, named group syntax and flags, so test there too before relying on a pattern.

What is catastrophic backtracking?

Some patterns, typically nested quantifiers such as (a+)+ on a long non-matching input, make the engine try an exponential number of paths and the page can freeze. This tool caps the input size and warns before running patterns that look risky, but it cannot interrupt the engine once it starts, so run suspicious patterns with short inputs.

What do the flags mean?

g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode matching, and y matches only at the current position.

Is my text uploaded?

No. Matching runs locally in your browser.

All free tools

Need something built?

Turn this into a real product with Soch Tech

These tools are free to use. If you need custom software, a database or a secure application, tell us what you are working on.