Regex Tester (JavaScript)

Test regular expressions against sample text with live matches.

3 matches

Uses JavaScript regex syntax (the flavor used in browsers and Node.js). Everything runs locally.

Type a pattern, set your flags and paste sample text β€” matches appear instantly with their positions and capture groups. Uses the JavaScript regex engine (the same flavor as browsers and Node.js), and your text never leaves the page.

How to use the Regex Tester

  1. Enter your regular expression pattern (without surrounding slashes).
  2. Set flags β€” g for all matches, i for case-insensitive, m for multiline.
  3. Paste test text and read the live match list with positions and groups.

Frequently asked questions

Which regex flavor does this use?

JavaScript (ECMAScript) β€” the engine built into your browser, identical to Node.js. Most patterns port from PCRE, but lookbehind and some escapes can differ in older environments.

Why does my pattern say invalid?

Common causes: an unescaped special character (., *, +, ?, (, ), [ need a backslash to match literally), an unclosed group or character class, or an invalid flag combination.

What do the g, i and m flags do?

g finds every match instead of just the first; i ignores letter case; m makes ^ and $ match at each line break instead of only the start and end of the whole string.