How to use the Regex Tester
- Type your regex pattern and choose flags.
- Paste the text to test — matches are highlighted instantly.
- Check the groups table, and optionally try a replacement.
About this tool
This tester uses your browser’s own JavaScript regex engine, so results match what String.match, replace and RegExp.exec do in JavaScript and Node.js. Most syntax (character classes, quantifiers, groups, lookahead) is the same in Python, PHP and Java, but details like named-group syntax and lookbehind support can differ.
Each match is listed with its position and capture groups, including named groups like (?<year>\d{4}). Beware of patterns with nested repeats such as (a+)+ — on some inputs they take extremely long to run (“catastrophic backtracking”), in any regex engine.
Frequently asked questions
What do the flags mean?
g finds all matches instead of the first, i ignores case, m makes ^ and $ match at each line, s lets . match new lines, and u enables full Unicode (needed for \p{…} classes).
Can I paste a regex like /abc/gi?
Yes — the slashes are removed and the flags after them are applied.
Is this the same as Python regex?
Mostly. JavaScript and Python share common syntax, but Python uses (?P<name>…) for named groups and has some different features.
Why does the page freeze with some patterns?
Patterns with nested quantifiers can backtrack exponentially. Simplify the pattern (for example avoid (a+)+).