💳 343,063 BIN records🏦 13,269 Issuing banks🌍 199 Countries🧰 30 Free tools

Regex Tester

Write a JavaScript regular expression and see every match highlighted as you type, with groups and a replace preview.

Flags:

Matches ·

About the Regex Tester

Regular expressions are compact patterns for finding and changing text: validating e-mail addresses or BINs, extracting numbers from logs, or cleaning data before an import. This tester uses your browser’s own JavaScript RegExp engine, so the results are exactly what your code will get in Node.js or the browser. Type a pattern without the surrounding slashes, choose the flags — g (global), i (ignore case), m (multiline anchors), s (dot matches new lines), u (Unicode) and y (sticky) — and paste your test text. Matches are highlighted live, and the table shows each match with its position, numbered capture groups and named groups such as (?<year>\d{4}). Empty matches are handled safely, and an invalid pattern shows the error message instead of breaking the page. Fill in the replace field to preview String.replace with $1, $<name> or $& references.

FAQ

Why is only the first match found?

Without the g (global) flag JavaScript stops after the first match, both in exec and in replace. Turn on g to find and replace every match.

How do I use named groups in the replacement?

Write a group as (?<name>...) in the pattern and use $<name> in the replacement. Numbered groups are available as $1, $2 and so on, and $& inserts the whole match.

Why does my pattern freeze the page?

Some patterns with nested repeats, such as (a+)+b, can take exponential time on certain text (catastrophic backtracking). Make repeats more specific or use anchors to avoid it.