Regex Tester
Free regex tester with live match highlighting, capture and named groups, replace preview and a library of common patterns. Runs safely in your browser.
- No upload — 100% private
- Instant, on your device
- Free, no sign-up
- Works offline once loaded
How it works
How to use Regex Tester
Type a pattern or pick one from Common patterns.
Toggle flags such as g, i, m, s, u and y.
Paste test text — every match is highlighted as you type, with groups listed alongside.
Switch to Replace to preview substitutions using $1, $<name> or $&.
Why use it
Why use our Regex Tester tool
Live highlighting
Matches are highlighted directly in the text, alternating colours for adjacent matches.
Groups and named groups
Every match lists its index range and capture groups, labelled with their names.
Replace preview
See the full result of String.replace with backreferences before you use it in code.
Pattern library
Ready-made patterns for email, URL, phone, IPv4, dates, times, hex colours, UUIDs and more.
Freeze-proof
Patterns run in a Web Worker with a time limit, so catastrophic backtracking can't hang the page.
FAQ
Frequently asked questions
Which regex flavour does this tester use?
It uses your browser's JavaScript (ECMAScript) engine — the same behaviour as RegExp in Node.js, Deno and front-end code, including lookbehind and named groups.
What do the g, i, m, s, u and y flags do?
g finds all matches, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode and \p{…} escapes, and y matches only at the current position.
What is catastrophic backtracking?
Patterns like (a+)+ can take exponential time on certain inputs. This tester stops any pattern that runs longer than 1.5 seconds and tells you, instead of freezing.
How do I reference groups in a replacement?
Use $1, $2… for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.
Why does my pattern only find one match?
Without the g (global) flag, JavaScript returns only the first match. Turn on g to find every occurrence.
Related tools
Find and Replace
Search and replace text with live highlights and regex support.
Diff Checker
Compare two texts side by side with word-level highlights.
JSON Formatter
Beautify, validate, minify and explore JSON as a tree.
Text Sorter
Sort lines A–Z, naturally, by length, reversed or shuffled.
Base64 Encode & Decode
Encode or decode Base64 text, files, images and data URIs.
URL Encode & Decode
Percent-encode, decode and edit URL query parameters.
Hash Generator
MD5, SHA-1, SHA-256, SHA-512 and HMAC for text or files.
UUID Generator
Generate v4 and v7 UUIDs in bulk, then validate and decode.