Regex Tester

Test a regular expression against your own text and see every match, its position and any capture groups, live as you type. Uses your browser’s own regex engine.

Also searched as: regular expression tester · regex checker · test regex online

Updated November 6, 2026

Loading the tool…

How to use it

  1. 1

    Enter a pattern

    Type a JavaScript-style regular expression.

  2. 2

    Choose flags

    Tick ignore case, multiline or dotall as needed.

  3. 3

    Paste your text

    Matches, positions and groups update as you type.

Questions about regex tester

Which regex flavour is this?

JavaScript (ECMAScript), the same engine your browser uses.

Does it show capture groups?

Yes, each match lists its captured groups and start position.

Is my text sent anywhere?

No, matching happens on your device.

Reading a regular expression

A regular expression describes a pattern of text. You type the pattern, paste some sample text, and the tester lists every match with its position and the contents of any capture groups. It uses your browser’s own JavaScript regex engine and always searches for every match, because the global flag is added for you. You can also switch on ignore case (i), multiline (m) and dotall (s).

An invalid pattern shows the engine’s own error message instead of a result, which is often enough to find a missing bracket or a stray escape.

TokenMeaningExample
\d \w \sA digit, a word character (letters, digits, underscore), a whitespace character\d{3} matches 2026
.Any character except a line break (with the s flag, line breaks too)a.c matches abc
^ $Start and end of the text (of each line with the m flag)^Hello matches a line starting with Hello
[abc] [^abc]One of these characters, or any character except these[aeiou] matches a vowel
a{2,4} a+ a* a?Repeat 2 to 4 times, 1 or more, 0 or more, 0 or 1go+gle matches gogle and gooogle
(a|b) (?<name>…)A group with alternatives, and a named capture group(cat|dog) matches cat or dog
\bA word boundary\bcat\b matches cat but not catalog

Common pitfalls

Greedy quantifiers take as much text as they can. In the text "<b>one</b> and <b>two</b>", the pattern "<b>.*</b>" matches from the first opening tag all the way to the last closing tag, while "<b>.*?</b>" stops at the first closing tag. Special characters such as . ( ) [ ] + * ? must be escaped with a backslash when you mean them literally.

Regex flavours differ. A pattern that works here may need small changes in Python, PHP or Java; for example, a named group is written (?<name>…) in JavaScript but (?P<name>…) in Python. An email pattern can only check the shape of an address, not whether the mailbox exists.

Related tools