FormatFlow

No tool matches “”

Try a format (“webp”, “mp3”) or a verb (“merge”, “compress”).

Loading index

↵to open

Developer Tools · Updated October 20, 2026

Regex Tester

You can test a JavaScript regular expression against your own text in the browser: matches are highlighted live, with positions, numbered capture groups, flag toggles and an optional replacement preview.

Runs in your browserFree · No sign-up · No watermark
PATTERN → MATCHESRuns in your browser
Loading the tool…

Everything runs locally in this tab. No file is uploaded while the tool loads.

This tool runs in your tab. Nothing is uploaded and no copy is stored.

How files are handled

At a glance

Works with
PATTERN → MATCHES
Processing
In your browser
Price
Free, no account
Updated
October 20, 2026
All Developer Tools

About Regex Tester

Regular expressions are compact and unforgiving: one misplaced backslash turns a pattern into a syntax error, and a pattern that behaves on a tiny example can do something unexpected on a real log file. This tester compiles the pattern with the JavaScript engine your browser actually uses, so flag behavior, capture groups and replacement rules match what your code will do.

Matches are highlighted in a read-only rendering and listed with their positions and numbered capture groups, which makes it easy to see why a greedy quantifier swallowed more than expected. An optional replacement field previews the output of a $1-style substitution, and the presets give you starting points for email addresses, URLs, phone numbers, dates and IP addresses.

What this tool does

The details that matter when you use Regex Tester for real work.
  • Six flag toggles

    Toggle g, i, m, s, u and y independently; the composed pattern shows exactly which flags will be compiled and copied.

  • Live highlighted matches

    Matches are marked in a read-only rendering of the text as you type, and zero-length matches get a visible caret marker.

  • Positions and capture groups

    Every match is listed with its number, start position, full text and each numbered capture group, including unmatched optional groups.

  • Replacement preview

    Type a replacement using $1, $2 or $& references and see the rewritten text and the number of replacements before changing code.

  • Engine-accurate errors

    An invalid pattern shows the browser's own RegExp message, which is the same explanation your runtime will give at execution time.

  • Pattern presets

    Email, URL, phone, date and IP presets fill the pattern and sensible flags, giving you a working starting point rather than an empty box.

How to use Regex Tester

No account, no installation — the whole job happens in this browser tab.
  1. 01

    Pick a preset or type a pattern

    Choose a common preset as a starting point, or write your own JavaScript pattern without the surrounding slashes.

  2. 02

    Set the flags

    Toggle g, i, m, s, u and y; the composed regex above the test text shows exactly what will be compiled.

  3. 03

    Add the test text

    Paste the text to search; matches are highlighted and listed as soon as the pattern and the text are both valid.

  4. 04

    Inspect the matches

    Read the match list for start positions and capture groups, and check the highlighted text to see what each part of the pattern consumed.

  5. 05

    Preview a replacement

    Type a replacement string with $1 or $& references to see the rewritten text and replacement count.

How this tool works

Works with
PATTERN → MATCHES
Processing
Client-side, in your browser. Nothing is uploaded.
Requirements
Chrome, Edge, Firefox or Safari · JavaScript enabled

Limitations worth knowing

  • Only JavaScript regular expressions are tested; PCRE, Python and .NET-only syntax such as inline flags or possessive quantifiers is not supported.
  • A single runaway match can still block the tab because matching is synchronous on the main thread; the caps limit long match lists, not pathological backtracking inside one match.
  • Matches are capped at 1,000, test text at 100,000 characters, patterns at 2,000 characters and replacements at 10,000 characters.
  • Zero-length matches are visible only as a thin caret marker in the highlighted preview because there is no character to highlight.

Privacy and file handling

The pattern, flags, test text and replacement are processed only in this browser tab by JavaScript and never uploaded, stored or logged. Reloading the page discards everything you entered, and no network request is made while matching.

Read the full privacy policy

Regex Tester FAQ

Short, direct answers to the questions people ask before using this tool.
Which regex flavor does this tester use?
It uses JavaScript's built-in RegExp engine, the same one that runs in your browser and in Node.js, so the syntax and behavior match JavaScript rather than PCRE, Python or Java. Most common constructs are portable, but engine-specific features are not.
Why do I only see one match when the g flag is off?
Without the global flag, JavaScript searches for the first match only, and this tester mirrors that behavior. Turn on g to list every match and to highlight all of them.
What does the y (sticky) flag change?
Sticky matching only accepts a match at the current lastIndex, which starts at zero here, so a sticky pattern must match at the very beginning of the text. It is mainly useful in parsers that advance through a string step by step.
Why does my pattern work elsewhere but fail here?
Regex syntax differs between engines. Inline flags such as (?i), possessive quantifiers, recursion and some Unicode property escapes are not part of JavaScript, while lookbehind and named groups are supported only in newer engines. This tester reports the JavaScript error, so adapt the pattern to the runtime that will execute it.
What causes catastrophic backtracking and can this tool stop it?
Nested quantifiers such as (a+)+ can explode into an enormous number of backtracking paths on certain inputs. The tester caps matches, caps input length and checks a time budget between matches, but a single runaway match runs synchronously on the page and can still freeze the tab. Test suspicious patterns on short text first.
How do I reference capture groups in the replacement?
Use $1 through $9 for numbered groups, $& for the whole match, $` and $' for the text before and after it, or $<name> for a named group. The preview follows the same rules as String.prototype.replace, so it is a direct check of your replacement string.
Is my test text uploaded or stored?
No. The pattern, flags, text and replacement are processed in the page's memory by JavaScript, and nothing is sent to a server or saved. Reloading the page clears everything you entered.
Why is a capture group shown as undefined?
An optional group that did not participate in a match is undefined rather than an empty string, which is exactly what JavaScript returns. The list labels it explicitly so you do not confuse it with a group that matched an empty string.
What does the u flag change about matching?
Unicode mode makes the pattern operate on code points instead of UTF-16 code units, changes some escape rules and turns invalid escapes into errors. It matters for emoji and characters outside the Basic Multilingual Plane, and it can reject patterns that are valid without it.

Background reading

Format guides that explain the trade-offs behind Regex Tester.