DIGITALDAY

Regex Tester (JavaScript)

Free JavaScript regex tester with live highlighting, capture groups, flags and replace preview.

//

#MatchIndexGroups

Test Regular Expressions Online

Write a JavaScript regular expression and instantly see every match highlighted in your test text, with the position of each match and its capture groups. Try a replacement with $1-style group references, switch flags such as g (global), i (ignore case) and m (multiline), or start from ready patterns for emails, Indian mobile numbers, PIN codes and PAN numbers.

Common Flags

FlagMeaning
gFind all matches
iIgnore upper/lower case
m^ and $ match at line breaks
s. also matches new lines
uUnicode mode (for Hindi and emoji)

The tester uses your browser's JavaScript engine, so results match JavaScript exactly; other languages may differ slightly. Compare text with the Text Diff Checker or format data with the JSON Formatter.

Frequently Asked Questions

Is my text sent anywhere?

No. Matching happens in your browser.

Why does my pattern freeze?

Some patterns with nested repetition can take very long on large text (catastrophic backtracking). Simplify the pattern or test on smaller text.