Free Online Regex Tester & Pattern Matcher

Try regular expressions in your browser: match, replace, split, and export against your own sample text. Built on the JavaScript RegExp engine—free to use, no account required, and your patterns and text are not uploaded to our servers.

Pattern

Flags

Subject text

Code generation

56 languages and environments. Choose a Category or Search, pick a Language, then copy the snippet. Non-JavaScript runtimes may differ; verify in your project.

#MatchIndexGroups

Replacement string: $& whole match, $1… groups, $\` before, $' after, $$ literal dollar.

Lists each match in order with position and captured text.

One rule per line. Optional: pattern || sample || shouldMatch(true/false). If you only enter a pattern, the subject text above is used.


        

Escape for regex literal

Stats

Enter a pattern and subject to see stats.

Named groups (ES2018+)

If the pattern uses (?<name>...), names appear below when there is a match.


            

Sample text