How to use
- Type the pattern without the delimiting slashes.
- Enable the flags you need (g, i, m, s, u, y).
- Paste the test text and see the highlighted matches.
- Inspect the numbered and named groups of each match.
- Try replacements with $1, $<name> and $&.
Use cases
- Validating formats such as email, phone numbers and postal codes before using them in forms.
- Extracting data from logs and text files.
- Building search-and-replace patterns for bulk refactors in your editor.
- Debugging regexes that fail in production.
Technical concepts
Flags
g finds every match, i ignores case, m makes ^ and $ work per line, s makes the dot match line breaks, u enables full Unicode mode (needed for \p{L}) and y requires a match exactly at the current position.
Capture groups
Parentheses create numbered groups; (?<name>...) creates named groups, available as $<name> in replacements. Use (?:...) to group without capturing, which makes the pattern faster and the numbering cleaner.
Catastrophic backtracking
Nested quantifiers such as (a+)+ can make the engine try an exponential number of paths and freeze the application (ReDoS). This tool runs the regex in a Web Worker with a 1-second limit, stopping problematic patterns without freezing the page.
Frequently asked questions
Which regex flavor is used?
Your browser's ECMAScript engine. The syntax is very close to PCRE, but features such as variable-length lookbehind and atomic groups may differ from other languages.
Why is only one match shown?
Without the g flag, only the first match is returned. Enable g to list them all.
Is there a match limit?
Up to 1,000 matches are shown to keep the interface responsive; the counter indicates when there are more.