Toolerax logoToolerax

Regex Tester

Test regex with live match highlighting.

100% private — runs in your browser, nothing is uploaded.

//g
3 matches
Contact alice@example.com or bob@test.org for details. Old address: carol@old.net
#MatchIndexGroups
1alice@example.com8
2bob@test.org29
3carol@old.net68

How to use the Regex Tester

  1. 1
    Enter your pattern

    Type the regular expression you want to test.

  2. 2
    Choose flags

    Toggle g, i, m or s to change how matching behaves.

  3. 3
    Paste your text

    Add the text you want to search.

  4. 4
    Read the matches

    Matches are highlighted, with positions and capture groups listed.

Examples

InputOutput
\d+ on 'abc 123 xyz 45'matches: 123, 45
\b\w+@\w+\.\w+\bmatches email-like strings

Free online regex tester

This regex tester lets you build and debug a regular expression against real text, with every match highlighted live as you type. Capture groups, match positions and the standard flags are all shown, so you can see exactly what your pattern is doing.

A quick regex cheat sheet

  • \d — any digit · \w — word character · \s — whitespace
  • . — any character (except newline, unless the s flag is set)
  • * — zero or more · + — one or more · ? — optional
  • {2,5} — between 2 and 5 times
  • ^ — start · $ — end · \b — word boundary
  • [abc] — any one of these · (...) — capture group · | — or

The most common mistake

Forgetting to escape special characters. A dot means “any character,” so example.com also matches exampleXcom. To match a literal dot, escape it: example\.com. The same applies to ? + * ( ) [ ] { } ^ $ | and the backslash itself.

Everything runs in your browser, so your patterns and test data stay private and the tool works offline.

Frequently Asked Questions

How do I test a regular expression?

Type your pattern in the regex field and paste your text below it. Every match is highlighted instantly, with a table showing each match, its position and any capture groups.

What do the g, i, m and s flags mean?

g finds all matches instead of just the first. i makes matching case-insensitive. m makes ^ and $ match the start and end of each line. s lets the dot match newline characters.

What are capture groups?

Parentheses in a pattern create capture groups, which extract part of a match. For example (\d{4})-(\d{2}) captures a year and a month separately. The groups appear in the results table.

Which regex flavour does this use?

JavaScript (ECMAScript) regular expressions, since it runs in your browser. This is very close to PCRE, though a few advanced constructs differ.

Why does my pattern match nothing?

Common causes are forgetting to escape special characters like . or ?, missing the i flag when case differs, or the dot not matching newlines without the s flag.

Is my text private?

Yes. The regex runs entirely in your browser, so your pattern and test data are never uploaded and the tool works offline.

From the blogRegular Expressions for BeginnersLearn regex from scratch: the core symbols, quantifiers, character classes, capture groups, greedy vs lazy matching, and the mistakes every beginner makes.Read the full guide

Related tools