Regex tester.
Write a regular expression, see every match highlighted as you type, inspect capture groups and preview replacements. Slow patterns are stopped automatically.
Runs in your browser. Nothing you enter is sent to KRA Digital or anyone else.
Matches highlighted
Match details
How to use it
- Type a pattern without the surrounding slashes, or pick a common pattern to start from.
- Choose flags: g finds every match, i ignores case, m makes ^ and $ work per line.
- Paste the text to test. Matches are highlighted and listed with their capture groups.
- Optionally enter a replacement using $1, $2 or $<name> to preview the result.
Questions
Which regex flavour does this use?
JavaScript (ECMAScript) regular expressions, as used in browsers and Node.js. Most syntax also works in other languages, but lookbehind, named groups and flags vary between engines.
Why was my pattern stopped?
Some patterns, such as nested quantifiers like (a+)+, can take exponential time on certain text. The tester runs patterns in a background worker and stops them after 1.5 seconds.
Should I validate email addresses with a regex?
Only loosely. A simple check for something@something.tld catches typos; the only reliable test is sending a confirmation email.
Is my text saved?
The pattern and test text are kept in this browser’s local storage so they survive a refresh. Nothing is sent anywhere.
Read more
Related tools
- Text & content
Text diff checker
Compare two texts line by line and see additions, deletions and changed words.
Open - Text & content
Duplicate line remover
Remove duplicate or empty lines, trim spaces and sort lists A–Z, by length or randomly.
Open - Developer
JSON formatter & validator
Format, validate, sort and minify JSON with clear error positions. Runs locally.
Open