Regex Tester

Test JavaScript regular expressions against sample text with match highlighting and named groups. Live results as you type.

About this tool

Test any JavaScript regular expression against sample text with immediate output: match count, the full match and each capture group, plus a precise error message when the pattern is invalid.

From parsing log lines to validating dates, emails and URLs — iterate live until the pattern exactly matches what you expect, then paste it into your code.

FAQ

Which regex flavor is used?

JavaScript (ECMAScript) regular expressions — the flavor used in browsers, Node.js and most web tooling.

What do the flags mean?

g = global (all matches), i = case-insensitive, m = multiline, s = dotall. Combine them freely, e.g. "gi".

What is a non-capturing group?

(?:...) groups without capturing. Use it when you only need grouping, not a backreference — cleaner output and faster matching.

Related tools