Regex tester

Enter a pattern, flags and some text. Matches are highlighted as you type, and each match is listed with its position and capture groups. It uses your browser's own JavaScript regex engine.

Matches in text

Released 2026-11-03, patched 2026-11-17.

2 matches

  1. 2026-11-03 at position 9
    • Group 1: 2026
    • Group 2: 11
    • Group 3: 03
  2. 2026-11-17 at position 29
    • Group 1: 2026
    • Group 2: 11
    • Group 3: 17

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type the pattern without surrounding slashes, for example (\d{4})-(\d{2}).
  2. Set the flags. Without g only the first match is found.
  3. Enter your test text. Matches are highlighted, and the list shows each match, where it starts and what every group captured.

How it works

The pattern and flags are passed to the JavaScript RegExp constructor. All matches are collected with matchAll, and zero-length matches (like ^ or a*) are listed with a symbol but not highlighted. Positions are counted from 0, in UTF-16 code units, like index in JavaScript.

Example: (\d{4})-(\d{2})-(\d{2}) on 2026-11-03 finds one match at position 0, with groups 2026, 11 and 03.

Cheat sheet

Pattern Meaning
\d, \w, \s digit, word character, whitespace
. any character except a line break
+, *, ? one or more, zero or more, optional
{2,4} between 2 and 4 times
(…), (?<name>…) capture group, named group
[a-z], [^a-z] a character in or not in the set
^, $ start and end (of each line with m)

Tips

  • Escape special characters with a backslash to match them literally: \. matches a full stop.
  • Add ? after a repeat (.*?) to make it match as little as possible.

Frequently asked questions

Which regex flavour does this use?

JavaScript (ECMAScript), the same engine as your browser. Features such as lookbehind and named groups work if your browser supports them. Other languages, such as PCRE, Python or Java, differ in details.

What do the flags mean?

g finds all matches instead of the first, i ignores case, m makes ^ and $ match at each line, s lets the dot match line breaks, u turns on full Unicode mode, y matches only at the current position, d records match indices and v is an extended Unicode mode.

Why are only the first matches shown?

The tool stops after 1,000 matches to keep the page responsive. The text itself is limited to 100,000 characters.

Why can the page freeze with some patterns?

Patterns with nested repetition, such as (a+)+b, can take exponential time on certain text, which is called catastrophic backtracking. A browser cannot interrupt a running regex, so simplify the pattern or shorten the text if the page stops responding.

Is my text uploaded?

No. Matching runs in your browser.

More in Developer

All tools in this category: Developer ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.