Regex Tester

Build, test & debug regular expressions live.

A regex tester is a tool that lets you write a regular expression and see, live, exactly which parts of your text it matches. This one highlights every match, inspects numbered and named capture groups, previews substitutions ($1,

lt;name>…) and toggles flags (g i m s u y d), with a pattern library and token cheat sheet. Runs fully in your browser on the native RegExp engine — nothing is uploaded.

How to use Regex Tester

  1. Enter your pattern

    Type or paste a regular expression into the pattern field of this free online regex tester to start building and debugging it instantly in your browser.

  2. Toggle the flags

    Switch on flags like g, i, m, s, u, y and d to control global, case-insensitive, multiline and Unicode matching and watch results update live.

  3. Paste test text

    Drop the sample text you want to check into the test string box and the regex tester highlights every match directly inside it as you type.

  4. Inspect the matches

    Review the match list and expand each card to see numbered and named capture groups, positions and zero-width matches found by your regular expression.

  5. Preview replacements

    Open the Replace panel to do regex find and replace with $1,

    lt;name> and
    amp; tokens and preview the substituted output instantly online.

  6. Copy or reuse

    Copy the finished pattern or the matched results, or load a ready-made pattern from the library to adapt for your own regex tester workflow.

Frequently asked questions

What is a regex tester and how do I use it?

A regex tester is an online playground for building, testing and debugging regular expressions against sample text. Type your pattern, toggle flags and paste a test string — this regex tester highlights every match in real time and shows numbered and named capture groups, just like regex101 or regexr.

Which regex flavour does this online regex tester use?

It runs on the browser's native JavaScript RegExp engine, so results match Node.js and front-end code exactly. Other dialects such as PCRE, Python re and .NET are mostly compatible but differ in some edge cases like lookbehind and certain escapes.

How do I test a regex with capture groups and see the matches?

Every match is highlighted directly in your test string, and each match card lists its position plus numbered groups like $1 and named groups like (?<name>...). Expand a match to inspect each captured group, including ones that did not match.

How do I do regex find and replace (substitution) here?

Click the Replace button to open the substitution panel, then enter a replacement using $1,

lt;name>,
amp; for the whole match and $ for a literal dollar sign. The live result preview updates as you type; add the g flag to replace all matches instead of just the first.

What do the regex flags g, i, m, s, u, y and d mean?

g finds all matches globally, i is case-insensitive, m makes ^ and $ match line breaks, s lets the dot match newlines, u enables full Unicode and \p{...} properties, y is sticky matching, and d exposes start/end indices for groups. Toggle any flag to see how it changes the matches.

Why does my regex freeze or run slowly?

An unbounded or nested-quantifier pattern can cause catastrophic backtracking, which can briefly hang the tab on certain inputs — the browser runs the regex, so there's no way to fully prevent this. Prefer specific quantifiers, anchors and non-capturing groups. This tester also caps how many matches it lists to keep rendering fast, but that cap can't stop a single slow pattern.

Is this regex tester free and is my pattern data private?

Yes. The tool is free and runs 100% in your browser, so your patterns and test text are never uploaded or stored. You can build and debug regular expressions offline once the page has loaded.

Related tools — Developer · Utilities