Test regex with live highlighted matches and a syntax cheat sheet.
Flags: g global · i ignore case · m multiline · s dotAll · u unicode · y sticky
.Any char (no newline, unless s flag)\d \DDigit / Non-digit\w \WWord char [A-Za-z0-9_] / Non-word\s \SWhitespace / Non-whitespace^ $Start / End of line (with m flag)\b \BWord boundary / Non-boundary[abc]Character set (any of)[^abc]Negated character seta|bOR(...)Capture group(?:...)Non-capturing group(?<name>...)Named capture group* + ?0+ / 1+ / 0 or 1{n} {n,m}Exactly n / n to m times(?=...) (?!...)Positive / Negative lookahead🔒 100% client-side — uses your browser's native RegExp engine (JavaScript / ECMAScript flavor).
A regular expression(regex) is a compact pattern language for matching text — validating emails, extracting order numbers, splitting logs, or finding-and-replacing. The trouble is that a regex is nearly impossible to read until you see what it matches. This tester shows every match highlighted live, lists each capture group, and includes a syntax cheat sheet.
g — global: find every match, not just the first. Without it, only the first match is returned.i — case-insensitive: [a-z] also matches [A-Z].m — multiline: ^ and $ match the start and end of each line, not just the whole string.s — dotAll: . matches newlines too (normally it does not).u — unicode: treat the pattern as Unicode code points (important for emoji and non-Latin scripts).Parentheses (...) create a capture group that remembers the portion it matched, accessible as $1, $2, etc. (left to right by opening paren). Named groups (?<name>...) are referenced by name. This tool lists every group for every match, which is the fastest way to debug a pattern like /Order #(\d+).*?\$(\d+[\d.]*)/ and confirm it captured the order number and price correctly.
The matches reflect the JavaScript (ECMAScript) RegExp engine running in your browser. It supports lookahead, named groups, and the s/u flags. It does not support lookbehind in older Safari (pre-16.4) or PCRE-only features like atomic groups and possessive quantifiers. If you test a pattern here it will behave identically in your JavaScript code.
The Regex Tester & Explainer handles regex testerdirectly in your browser. Paste or type your input, and the tool processes it instantly — no upload, no signup, no waiting. It's built for the moments when you need a quick transformation and don't want to leave your workflow.
Because the tool runs client-side, it's fast and private. Your text never touches a server, which makes it safe for sensitive content. The interface is keyboard-friendly and works on any device with a modern browser.
Common uses: people reach for this tool when they need to use a regex tester with capture groups, regular expression highlighter online, javascript regex tester online, or regex cheat sheet and tester.
Browser-based tools like this one have a few real advantages over installed software or manual methods:
More tools you might find useful