Kitloft

All tools / Data & text

JavaScript regex tester and checker

Type a pattern and some text to see every match, its capture groups and a replace preview.

//
Matches

JavaScript

Common patterns

Runs entirely in your browser. Nothing you type or upload is sent to a server.

Found it useful? Share it:WhatsAppTelegram

How to use JavaScript regex tester

  1. Type your regular expression, or pick a ready-made pattern.
  2. Set the flags, such as global or ignore case.
  3. Paste your test text to see every match and its capture groups.
  4. Optionally type a replacement to preview the result.

Common questions

Which regex flavour does this use?

JavaScript (ECMAScript), the same engine as Node.js and browsers. Most syntax is shared with Python, Go and PCRE, but lookbehind support, possessive quantifiers and flags can differ.

Why does my pattern match only once?

Without the g (global) flag, JavaScript stops at the first match. The replace preview also replaces only the first match.

What do the m and s flags change?

m makes ^ and $ match at the start and end of every line. s lets . match newlines too.

Why did my browser tab freeze?

Patterns with nested repeats like (a+)+ can take exponential time on some inputs (catastrophic backtracking). Make the inner part more specific.

Was this page useful?