Test and debug regular expressions in real time with instant match highlighting, capture group extraction, and detailed match information. This free online regex tester uses JavaScript's native RegExp engine and supports all flags including global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u). Paste your pattern and test string to see matches highlighted instantly. All processing happens client-side — nothing is sent to a server.
Test regular expressions against real input with live highlighting, capture groups, and match counts. The tester uses JavaScript regex flavor by default — same engine as your browser, Node.js, and most modern web stacks. Patterns and test data stay local; nothing is sent to a server.
m flag to make ^/$ match line boundaries./foo/g → foo); pick flags from the toggles.$1, $2, etc..* matching too much. By default .* grabs as much as possible. Use .*? (lazy) when you want the shortest match — e.g. inside HTML tags.. matches any character. Use \. for a literal period (e.g. matching example\.com).m flag. ^/$ match start/end of string, not line, unless you set the multiline flag.(a+)+ on long inputs can hang for seconds — exponential complexity. Use atomic groups or possessive quantifiers (where supported) or rewrite to be linear.re, and Ruby. Lookbehinds, named groups, and Unicode property escapes vary. Test in the dialect you'll deploy with..+@.+\..+) and verify deliverability separately — or use a library.RegExp engine — the same engine that runs in Chrome, Firefox, Node.js, and Deno. Capture groups are extracted and displayed with their index and position. All processing runs in your browser with zero server calls.g (global) — find all matches, not just the first. i (case-insensitive) — /abc/i matches "ABC", "Abc", etc. m (multiline) — ^ and $ match start/end of each line, not just the whole string. s (dotAll) — . matches newline characters (\n). u (unicode) — enables full Unicode support and proper handling of surrogate pairs.*, +, {n,}) match as much text as possible. Lazy quantifiers (*?, +?, {n,}?) match as little as possible. Example: on the string <b>hello</b>, the greedy pattern <.*> matches the entire string, while the lazy <.*?> matches only <b>. Use lazy quantifiers when you want the shortest possible match.^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. This covers the vast majority of valid email addresses. The full RFC 5322 specification is extremely complex and nearly impossible to match with a single regex. For production applications, use a dedicated email validation library or send a confirmation email rather than relying on regex alone.() to extract specific parts of a match. For example, the pattern (\d{4})-(\d{2})-(\d{2}) on the string "2026-03-20" creates three groups: "2026", "03", "20". Named groups use (?<name>...) syntax for clearer code. Non-capturing groups (?:...) group patterns without capturing — useful for alternation like (?:cat|dog).