Pattern
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.
| # | Match | Index | Groups |
|---|
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.