Regex Tester
Test a regular expression against a string, with matches highlighted live and every capture group listed.
Type a regular expression pattern into the pattern field, choose which flags to apply, and paste or type text into the test string box. Every match is highlighted directly in the text as you type, and each individual match, along with any captured groups, is listed below.
The g flag finds all matches instead of stopping at the first one, i makes the match case-insensitive, m changes how the caret and dollar sign anchors behave across multiple lines, and s allows the dot character to match newline characters as well.
This is useful for building and debugging a regular expression before using it in code, checking whether a pattern correctly matches the kinds of input you expect, or understanding what a regex found in someone else's code actually matches.
What does the g flag do?+
It makes the regex find every match in the string instead of stopping after the first one. This tool always searches globally to show you every match.
Why does my pattern show an error?+
The pattern you entered is not valid JavaScript regular expression syntax. Check for unmatched parentheses or brackets, or an unescaped special character.
Are capture groups shown?+
Yes, if your pattern includes parentheses to capture groups, each match's captured groups are listed below the match itself.
Is my text sent to a server?+
No. Testing happens entirely in your browser using JavaScript's built-in regular expression engine.