jsondecode.com logo

Regex Tester

Test and debug regular expressions in real time. Highlights all matches, shows capture groups, and supports find-and-replace. Runs entirely in your browser.

Quick patterns

//
Test String
Match Preview
Match highlights appear here…

How to Use This Regex Tester

Enter a regular expression in the pattern field (without slashes) and toggle flags using the buttons on the right. Paste your test string and matching substrings are highlighted in real time. The Match Details panel shows every capture group and named group for each match.

Switch to the Find & Replace tab to perform substitutions. Use $1, $2 to reference capture groups, and $& for the full match. Replacements run against the JavaScript String.prototype.replace engine.

Regex Flags

g — Global
Find all matches instead of stopping at the first one.
i — Case insensitive
Match upper and lower case letters interchangeably.
m — Multiline
^ and $ match the start and end of each line, not just the string.
s — Dot-all
The . metacharacter matches newline characters (\n) as well.