Regex Tester
Write a JavaScript regular expression, paste sample text, and see every match with its position and capture groups.
Your input stays in your browser. Nothing is uploaded.
- 2 matches
- Hello @0
- 123 @6
About this tool
Patterns use the JavaScript (ECMAScript) regex flavour that runs in your browser. Supported flags are g, i, m, s, u, and y; the g flag is always added so that all matches are listed, and the list stops at 200 matches. Syntax from other flavours, such as possessive quantifiers or inline flags like (?i), is not supported and shows an error.
How to use it
- Enter the pattern without surrounding slashes.
- Add flags such as i for case-insensitive matching.
- Paste the test text and read the match list, including capture groups.
new RegExp(pattern, flags)
Examples
Numbers
Pattern \d+ on "Order 42 ships in 3 days" matches 42 at index 6 and 3 at index 18.
Capture groups
Pattern (\w+)@(\w+)\.com on "ana@site.com" matches once, with groups "ana" and "site".
FAQ
Is this PCRE or JavaScript regex?
JavaScript. Most everyday syntax is shared, but lookbehind rules, named groups, and flags can differ from PCRE, Python, or .NET.
Why are only 200 matches shown?
The list is capped to keep the page responsive with patterns that match very often.
Can a pattern freeze the page?
Patterns with nested quantifiers, such as (a+)+, can take a very long time on some inputs. Reload the page if that happens and simplify the pattern.

