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.
More tools you might find useful
Decode 4-6 band resistor color codes, or turn ohms back into colors.
Build a correct robots.txt with presets and live preview.
Convert titles into clean, SEO-friendly URL slugs instantly.
Beautify SQL queries with clean indentation and uppercase keywords.