Pages

Topics

Tools

↑↓navigate↵openescclose
Formatting & Data

Regex Tester

Test a regular expression against sample text with live match highlighting, capture groups, a token-by-token explainer, a pass or fail test suite, ReDoS warnings and the real match time.

Runs entirely in your browser — nothing you paste is uploaded.

Regex cheat sheet

quick reference
\d \w \s .
Digit, word character, whitespace, and any character except a newline. Upper case negates each one.
^ $ \b
Start of input, end of input, and a word boundary — anchors match a position, not a character.
* + ? {n,m}
Zero or more, one or more, optional, and an explicit count or range of repetitions.
( ) (?: )
A capture group records what it matched as $1, $2; a non-capturing group only groups without recording.
(?=) (?!)
Positive and negative lookahead: check what follows without consuming it.
g i m s
Global, case-insensitive, multi-line anchors, and dot-matches-newline flags.

Frequently asked questions

answered below the tool
Which regex engine does this use?

The browser's JavaScript engine, so lookbehind and named groups work, while PCRE-only syntax such as \A does not.

Why does my pattern match only the first result?

Without the g flag a pattern stops at the first match; add g to collect every match and to make the replace global.

What does a non-capturing group do?

(?:…) groups without recording a capture, so $1 still points at the group you need and the engine does less work.

All Python guides