RegExp Tester
Write a regex and test it against a sample string in real time. The tool shows all matches, capture groups, and group names with highlighting. Supports all JavaScript regex flags (g, i, m, s, u, y, d) and shows match indices when the d flag is used. Error messages explain what's wrong with invalid patterns.

What it does
- ▸Tests regex patterns against input text with real-time match highlighting
- ▸Shows all matches, capture groups, and named groups
- ▸Supports all JS regex flags: g, i, m, s, u, y, d
- ▸Displays match indices when the d (indices) flag is used
- ▸Reports regex syntax errors with explanations
Use cases
- ▸Debugging a regex that's not matching as expected
- ▸Testing capture groups before using them in code
- ▸Experimenting with regex flags to understand their effect
- ▸Validating a pattern before deploying it in production
How it works
Enter your regex pattern in the pattern field
Set the flags you need (g for global, i for case-insensitive, etc.)
Paste your test string into the input pane
Matches and groups are highlighted and listed in the output
Frequently asked questions
1Which regex engine does it use?
The tool uses the JavaScript regex engine (the same one in Node.js and browsers). This means it supports the same syntax and flags as JavaScript. If you're testing regex for Python or Go, the syntax may differ slightly.
2What does the d flag do?
The d flag (added in ES2022) enables match indices. With it, the tool shows the start and end position of each match and each capture group. Without it, you only get the matched text, not its position.
3Can I test lookbehind assertions?
Yes, if your browser supports them (all modern browsers do). Lookbehind (?<=...) and negative lookbehind (?<!...) are supported by the JavaScript engine in modern environments.
Related tools

Line Filter (grep)
Filter lines by plain text, keywords or a regex — like grep, but visual

Data / IOC Extractor
Pull emails, URLs, IPs, domains, hashes, UUIDs and MACs out of any text

String Inspector
Inspect length, words, lines, bytes and unicode code points

Line Sort/Dedupe
Sort, deduplicate, reverse and trim lines of text
Use RegExp Tester offline in Devinity
All 95 tools run locally on your Mac. No internet required, no data sent to servers.
Download Devinity →