Regex Tester
Test a regular expression against your text and see every match, highlight and capture group.
How to Use This Regex Tester
Type a pattern in the first box, set flags if needed, and paste your sample text. Every match is listed and highlighted as you test.
- g — find all matches, not just the first.
- i — ignore uppercase and lowercase differences.
- m — treat
^and$as start and end of each line. - s — let
.match newline characters too.
Frequently Asked Questions
Which regex flavor does this use?
JavaScript (ECMAScript). It supports character classes, groups, lookahead, named captures and the standard flags. Some PCRE-only features are not available.
Why do I only get one match?
Add the g flag. Without it the engine stops at the first match.
What does a backslash mean?
It escapes the following character. \d means a digit, \s a whitespace character, and \. a literal dot.
Are my patterns sent anywhere?
No. Matching runs entirely in your browser — nothing leaves your device.
Why is my pattern invalid?
Unbalanced brackets or parentheses, an unfinished group, or an unknown flag are the usual causes. The error message under the box tells you what the engine reported.
Practical Example
Find every number in the text Order 42 ships in 7 days using the pattern \d+ with the g flag.
- Matches:
42and7— two results. - Changing the pattern to
[A-Z]\w+finds the capitalized words instead. - Adding the
iflag makes letter classes case-insensitive.
What Your Results Mean
- Matches found — how many times the pattern matched in the text.
- Match list — each matched substring, in order.
- Highlighted text — your text with every match marked, so you can spot false positives.
- Capture groups — parenthesized parts of the pattern that capture sub-matches.