Test a regular expression
Test a JavaScript regular expression against your own text, see every match and capture group, and read the pattern back in plain English.
- Free, no account
- Nothing is uploaded
- Runs in your browser
How it works
- 1 What goes in A pattern and some text
- 2 It runs in your browser On your own device. Nothing is uploaded, there is no queue and no account, and it keeps working with the network switched off.
- 3 What comes back Every match, and each group
What it does
Type a pattern and some text. Every match is highlighted in place, each capture group is listed, and the pattern itself is explained token by token — which is usually faster than reading it.
This page does the work itself. Your pattern is handled by the browser and never sent anywhere — there is no server here to send it to.
Questions
Which flavour of regex is this?
JavaScript's own, because the page runs in your browser and hands the pattern to the same engine your code would. Lookbehind, named groups and the u and v flags work wherever your browser supports them. PCRE, RE2 and Python's re differ in places — possessive quantifiers and atomic groups do not exist here, and \A and \z are ^ and $.
Can a pattern hang the page?
Yes, and this is the one real risk in any regex tester. Nested quantifiers over a long string — (a+)+b is the classic — can take exponential time, and JavaScript has no way to interrupt a running match. The test text is capped and the match is timed, so a pattern that starts running away is reported rather than left to freeze the tab.
Is my test data sent anywhere?
No. The pattern and the text stay in the page; there is no server here. Regex testers that log the patterns people try are a real thing, which is a reason to prefer one that cannot.
More developer tools
-
Developer
Text ⇄ binary
Translate text to binary, hex or octal and back again, in UTF-8.
-
Developer
Base64
Encode text or a file to Base64 and decode it back, with URL-safe output and data URIs.
-
Developer
SHA hashes
Compute SHA-1, SHA-256, SHA-384 and SHA-512 for text or a file, using your browser's own crypto engine.
-
Developer
Unix time
Convert Unix time to a date and back, in UTC and your own timezone at once, with seconds and milliseconds.
-
Developer
URL encode
Percent-encode a URL or a single value and decode it back, with the encodeURI and encodeURIComponent distinction made explicit.
-
Developer
UUID
Generate v4 random or v7 time-ordered UUIDs in bulk, from your browser's cryptographic random source.
-
Developer
JWT decoder
Read a JWT's header and payload, with expiry checked against the clock.
-
Developer
Cron expressions
Turn a cron expression into plain English and see its next five run times, in your own timezone and in UTC.
-
Developer
cURL converter
Paste a curl command and get it back as JavaScript fetch, Python requests and a raw HTTP request.