Regex tester
Write a pattern, pick your flags, and watch the matches highlight as you type.
Matching runs in a worker with a two second limit, so a pattern that would otherwise hang the tab is stopped instead.
0 matches
ahad@example.com and someone@other.com
Matching runs in a worker and is stopped after 2 seconds. A pattern that nests one repeat inside another, like (a+)+, can take longer than the universe has left on input that nearly matches, and a regex cannot be interrupted once it starts. Killing the worker is the only way to get the page back.
Questions
- Is what I paste sent anywhere?
- No. Every tool in this kit runs in the page itself. There is no server here that receives what you paste, and you can check it in your browser's network tab: using a tool produces no request carrying your input at all.
- Why does matching get stopped after two seconds?
- Because a pattern that nests one repeat inside another, like (a+)+b, can take longer than the universe has left on input that nearly matches. JavaScript cannot interrupt a regex once it starts, so the only way to get the page back is to run it somewhere that can be terminated. That is what the worker is for.
- Which flavour of regex is this?
- JavaScript's own, exactly as your browser implements it. So lookbehind and named groups work, and things that only exist in PCRE, like recursion or possessive quantifiers, do not.
- Are named groups supported?
- Yes. Write (?<name>...) and every match lists the group by name as well as by number.
- Why does it stop at a thousand matches?
- Because past that the list stops being something you read and starts being a memory problem. The tool says when it has stopped early rather than quietly showing you part of the answer.
The other tools here
- JSON formatter, format, minify and validate
- Base64 encoder, encode and decode, text or file
- URL encoder, encode and decode, two rules
- UUID generator, version 4, one to a hundred
- Hash generator, sha-256, sha-1 and md5 at once
- JWT decoder, header, payload and expiry
- Text diff, compare two blocks, by line or word
- Timestamp converter, unix time to a date, and back
- Cron explainer, a schedule, in plain english
- Colour converter, hex, rgb, hsl, and a contrast check
- Markdown preview, live preview, and copy the html
- JSON to CSV, an array of objects into a spreadsheet