← All tools
// Code

Regex Tester online

Test regular expressions with live match highlighting and group capture

Regex Tester logo
by
CHUNKY
MUNSTER
/ /
// Test String
// Match highlights

How to Use the Regex Tester

  1. Type a regex pattern between the slashes, without quotes.
  2. Toggle flags (g, i, m, s) using the buttons or type them into the flags box.
  3. Paste the test string in the textarea — matches highlight as you type.
  4. Inspect numbered and named capture groups beneath the highlights.

A regex tester is only useful if it behaves identically to the engine you ship to production. This tool runs your pattern through the browser's native RegExp constructor, so the matches you see here are exactly what your JavaScript code will see — including the quirks around Unicode, sticky matching, and zero-width assertions.

How the Regex Tester Works

Each match is highlighted in place and broken down into numbered and named capture groups. When the pattern is invalid, the SyntaxError from the engine is surfaced verbatim instead of being silently swallowed, which makes it much faster to track down a runaway quantifier or an unescaped bracket.

Frequently Asked Questions

Which regex flavour does this tester use?

It uses the browser's native JavaScript RegExp engine (ECMA-262). Patterns and flag behaviour will match exactly what runs in Node.js, Chrome, Firefox and Safari — but not PCRE, Python, or .NET regex.

Are lookbehinds supported?

Yes. Modern browsers (Chrome 62+, Firefox 78+, Safari 16.4+) support both positive (?<=…) and negative (?

Why are my capture groups showing as undefined?

A group can be undefined when it sits inside an alternation that didn't match, or after a quantifier that matched zero times. The tool shows the literal string <undefined> in those slots so you can spot the difference from an empty string.

How do I match across multiple lines?

Use the m flag so ^ and $ match at every line break, or the s (dot-all) flag so . matches newlines. The two are independent — pick the one that fits the pattern you're writing.

Explore the full suite of Code tools and 290+ other free utilities at Chunky Munster.

📖 Reference: ECMA-262 — ECMAScript Regular Expression Syntax