Regex Tester with Explanations & Groups
Test JavaScript and Python regex with live match highlighting. See groups, indices, captured values and match counts, plus common pattern presets.
How it works
- Type or paste a regex pattern and flags — the tool uses JavaScript's native
RegExp, so any valid JS regex works. - Click Test to highlight every match in the test text and list each capture group with its start and end indices.
- Click Explain to get a human-readable breakdown of what each token in your regex does.
- Pick a preset to instantly load a common pattern like email, URL, or IP address matching.
Groups, captures and what backreferences match
A capture group records the substring it matched so it can be referenced later — in the replacement string, in a conditional, or through a backreference such as `\1`. Group numbering follows the order of opening parentheses, including groups inside lookarounds.
Named groups (`(?<name>...)` and `\k<name>`) survive refactoring in a way numbered groups do not, and they make an expression self-documenting. They are supported in JavaScript and Python; support elsewhere varies by flavour.
Lookarounds
A lookahead `(?=...)` asserts what follows without consuming it, a lookbehind `(?<=...)` asserts what precedes. This is how you match a word boundary that is not whitespace, or require quotes without consuming them, which keeps the match available to the surrounding pattern.
Lookbehind must be fixed-width in JavaScript, which rules out `(?<=a*)`. A character-class alternative such as `(?<=[^,])` is usually the workaround.
Frequently Asked Questions
How do I test advanced regex patterns?
How is this different from the basic Regex Tester?
Is my data sent to a server?
Do I need an account or API key?
Can I use these tools offline?
All processing happens in your browser. No uploads, no tracking, no servers. Your API keys, configs, and private payloads stay private — 100% client-side.