Regex Tester

Test regular expressions live - highlight matches, inspect capture groups and preview replacements. Runs in your browser.

0 matches

#MatchGroupsIndex

What is a Regex Tester?

A regular expression (regex) is a pattern used to search and manipulate text. This tester lets you build a pattern, toggle flags, and instantly see what it matches in your sample text, inspect the capture groups, and preview a find-and-replace - all evaluated locally in your browser using JavaScript's RegExp engine.

How to use it

  • 1. Type your pattern and choose flags (global, ignore case, multiline, …).
  • 2. Enter a test string - matches are highlighted live and listed with their groups.
  • 3. Add a replacement (with $1, $2, $&) to preview the result.

Features

  • Live highlighting - matches are marked in the test string as you type.
  • Full flag control: g, i, m, s, u, y.
  • Capture-group table showing each match, its groups and start index (first 50).
  • Replacement preview using $1, $2 and $& syntax.
  • Plain-English error messages when a pattern is invalid.
  • Runs entirely in your browser - your pattern and text are never uploaded.

Common uses

Validating emails, slugs or phone formats before the pattern goes into code; pulling fields out of log lines; drafting a find-and-replace for a bulk edit; or simply learning how a tricky pattern behaves against real sample text before you trust it. Building the pattern here first saves a round-trip through your editor and test suite.

FAQ

Is my text or pattern sent to a server?

No. The pattern and test string are evaluated entirely in your browser with JavaScript's RegExp engine, so nothing is uploaded or stored.

Which regex flavor does this use?

JavaScript's RegExp, which follows the ECMAScript standard. Most common patterns work as-is, but a few features such as lookbehind or named groups depend on your browser version.

What do the regex flags mean?

g matches all occurrences, i ignores case, m makes ^ and $ match each line, s lets the dot match newlines, u enables full Unicode, and y anchors at lastIndex (sticky).

How do I use capture groups in the replacement?

Reference them with $1, $2 and so on, and use $& to insert the whole match. The Result box previews the replacement live as you type.

Related tools