Regex Tester
Pattern, flags, text — matches light up as you type.
Matched in your browser — test data never leaves this page.
Pocket reference
| Pattern | Matches |
|---|---|
\d / \w / \s | digit / word char / whitespace |
+ / * / ? | one+ / zero+ / optional |
{3} / {2,5} | exactly 3 / between 2 and 5 |
^ / $ | start / end of line (with m flag) |
(…) / [abc] | capture group / character set |
Common questions
How do I test a regular expression?
Type the pattern (without surrounding slashes), optional flags (i for case-insensitive, m for multiline, s for dotall), and your test text — matches highlight live, with each match's position and capture groups listed below.
Why does my pattern say "Invalid regular expression"?
Usually an unclosed bracket or parenthesis, or a stray special character that needs escaping (\. for a literal dot, \( for a literal parenthesis). The error message quotes the engine's specific complaint and lingers long enough to read.
Which regex flavor is this?
JavaScript's — what runs in browsers and Node. Nearly everything carries over to Python/PCRE, with small differences in lookbehind and named-group syntax at the edges.
Is my test data sent anywhere?
No — matching runs in your browser, which matters since test text is often real data: logs, emails, customer records.