Developer & Text Tools
Regex Tester
Pattern
Test text
Highlighted matches
Matches
Matches
0
Groups
0
Named
0
| # | Match | Index |
|---|
How to use this tool
- 1Type a pattern (without slashes) and toggle the flags.
- 2Paste the text to test, or start from the pattern library.
- 3Read the highlighted matches and the groups table.
- 4Switch to Replace or Split to preview the result, then copy it.
Frequently asked questions
JavaScript (ECMAScript), exactly as your browser runs it, including named groups, lookbehind, the u and s flags and \p{…} Unicode classes. Most patterns also work in Python, Java and PCRE, but check flavour-specific features.
a* can match zero characters, so it matches the empty string at every position where there is no "a". The tester shows these as empty matches and moves on, instead of looping forever.
Matching runs in a background worker with a 1.5 second limit. Patterns with catastrophic backtracking, such as (a+)+$, are stopped with a warning and the page stays responsive.
Use $1 to $9 for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.
No. Everything runs in your browser with JavaScript. The text you paste is not uploaded, logged or stored by MuhammadLab.