Skip to content

Regex Tester

Write a pattern and a flag set, paste the text to test it against, and see every match highlighted with its numbered and named capture groups broken out individually — updated live as you type.

  • Highlights every match, not just the first
  • Breaks out numbered and named capture groups
  • Supports g, i, m, s, u, y flags
  • Match count and position shown per result
  • Runs fully client-side

Tester

Matched locally, nothing uploaded

Flags

Highlighted text

How to test a regular expression

  1. 01

    Write the pattern

    Enter the regular expression itself, without the surrounding slashes.

  2. 02

    Set the flags

    Toggle case-insensitive, multiline, or the other flags the pattern needs.

  3. 03

    Paste the text to test

    Every match is highlighted, with its capture groups listed below.

Why matches show up even without the g flag#

In JavaScript, the "g" (global) flag controls whether String.prototype.match returns one result or all of them — without it, most tools would show only the first match and leave you toggling a checkbox to see the rest. This tool always searches globally internally, so every match is visible regardless of whether "g" is checked; the checkbox instead reflects the flag combination you would actually use in code, since the other flags (case-insensitivity, multiline, dot-matches-newline) still change what counts as a match.

Numbered groups versus named groups#

(\d{4})-(\d{2}) captures two numbered groups, accessible in code as match[1] and match[2]. (?<year>\d{4})-(?<month>\d{2}) captures the same two values but as named groups, accessible as match.groups.year and match.groups.month — more readable in code that touches the pattern months later. Both forms are broken out separately under each match here, so it is clear which capture corresponds to which part of the pattern before it goes into actual code.

A pattern engine, not a pattern generator#

This tool executes the regular expression you write and shows you what it actually matches — it does not write the pattern for you, and it does not explain the syntax token by token. It is the fastest way to confirm a pattern behaves as expected against real sample data before it ships inside validation code, a .replace() call, or a router rule.

Frequently asked questions

Which regex flavor does this use?

JavaScript's native regex engine (the same one Node.js and every browser use) — patterns should behave identically to what `new RegExp()` in your own code would do.

Why do I see all matches even though I did not check the "g" flag?

The tool always searches for every occurrence internally so nothing is hidden. The "g" checkbox reflects the flag you would use in actual code — the other flags (i, m, s, u, y) still affect what counts as a match.

What's the difference between numbered and named groups?

Numbered groups `(...)` are accessed as `match[1]`, `match[2]` in order. Named groups `(?<name>...)` are accessed as `match.groups.name` — same capture, more readable reference.

Is my text or pattern sent anywhere?

No. Matching runs entirely in your browser using the native regex engine — nothing is uploaded.

Developers

UUID Generator

Generate cryptographically random UUID v4 or time-ordered UUID v7, in bulk.

Developers

Base64 Encoder & Decoder

Encode and decode Base64 with correct UTF-8 handling, including the URL-safe alphabet.

Developers

ULID Generator

Generate ULIDs — sortable by creation time like UUID v7, but Crockford Base32 instead of hex.