Test regular expressions
Type a pattern and flags, paste sample text, and see matches highlighted live with the full match list and capture groups.
Drop your file here
or click to browse
How it works
Type a pattern and flags, paste sample text, and see matches highlighted live with the full match list and capture groups.
Pattern field for the regex body, flags field for the modifiers (g for global, i for case-insensitive, m for multi-line, s for dotall, u for Unicode, y for sticky). Test text area for the input you want to match against. The tool compiles the regex with new RegExp, runs it against your text, and highlights every match. With the g flag, all matches are shown; without it, only the first. The match list below shows each match with its index in the text and any capture groups (numbered, unnamed groups). Invalid regex shows the parse error inline. This is JavaScript regex flavour, not Perl or .NET, so PCRE-only features (recursion, conditionals) aren't supported. Lookahead and lookbehind work in modern browsers.
How to use it
- Type your pattern and flags. Enter the regex body and modifiers like g, i, m, s, u, or y.
- Paste your test text. Every match highlights live; invalid patterns show the parse error inline.
- Inspect the matches. The list below shows each match with its index and every capture group's value.
Frequently asked questions
- What regex flavour is this?
- JavaScript / ECMAScript. Modern features (lookbehind, named groups, Unicode property escapes with u flag) work. PCRE-only features (recursion, conditionals) don't.
- How do I match across multiple lines?
- Add the m flag to make ^ and $ match line boundaries. Add the s flag to make . match newlines.
- Can I see capture groups?
- Yes. The match list shows each capture group's value for every match.
- Is my text uploaded?
- No. Regex compiles and runs in your browser.