Free Online Regex Tester
The Regex Tester checks your regular expressions against sample text and highlights every match. Toggle flags like global, case-insensitive, and multiline, then review the results.
How to use the Regex Tester
- 1 Type your pattern into the expression field, without the surrounding slashes.
- 2 Set the flags you need — g for global, i for case-insensitive, m for multiline, s for dot-matches-newline.
- 3 Paste sample text into the test area; matches are highlighted live as you type.
- 4 Open the match list to see each capture group and its position, which is how you debug a pattern that almost works.
How to Use
Enter a pattern and your test text, choose flags, and see matches highlighted live. The match count and captured groups are shown below.
- Live match highlighting in the text
- Global, case-insensitive, and multiline flags
- Shows match count and capture groups
Frequently asked questions
Why is my pattern matching more than I expect?
Quantifiers are greedy by default — ".*" consumes as much as possible. Add a "?" after the quantifier (".*?") to make it lazy so it stops at the first valid match instead of the last.
What does the global flag actually change?
Without "g", matching stops at the first hit. With it, every match is found. It also affects stateful behaviour in JavaScript, where a global regex remembers its position between calls — a common source of confusing bugs.
Which regex dialect does this use?
JavaScript (ECMAScript) syntax, because that is what runs in your browser. Lookahead, lookbehind and named groups are supported; features exclusive to PCRE or Python such as atomic groups are not.