Home / Developer tools / Regex Tester
Regex Tester
Regular expressions are quicker to test than to reason about. Type a pattern and some sample text: every match is highlighted as you type, with a count and the contents of any capture groups.
How to use it
- Enter the pattern, without the surrounding slashes.
- Set flags — g for all matches, i to ignore case, m for multiline.
- Paste sample text and watch the highlights update.
Examples
- \\b\\w+@\\w+\\.\\w{2,}\\b highlights e-mail addresses in a paragraph.
- ^\\d{4}-\\d{2}-\\d{2}$ with the m flag validates dates line by line.
- Brackets create capture groups, whose contents are listed under the highlighted text.
Questions people ask
Which flavour of regex is this?
JavaScript's, the same one you get in the browser and in Node. Most basic syntax is shared with Python, PHP and Perl, but lookbehind support and some named-group syntax differ, so verify anything unusual in your target language.
Why is my pattern slow or stuck?
Nested quantifiers such as (a+)+ can cause catastrophic backtracking, where the engine explores an exploding number of paths. Make the inner parts more specific, or anchor the pattern, to keep it linear.
Related tools
Updated: 2026-08-07