Regex Playground — Test Patterns, Free | How to use and interpret results
Apply a JavaScript regular expression and flags to a short test string, showing match contents and positions. Other languages and search systems can implement different regex dialects.
- Runs in your browser
- Nothing is uploaded
- No signup; device limits apply
Numbers stay on your device. Nothing is sent to a server.
How to use this tool
Enter the pattern without surrounding slashes and put flags such as g or i in their own field. Start small because nested repetitions can be slow on long input.
Results and examples
Pattern cat with g against cat dog cat yields two matches. Positions are string indexes, which need not equal visual columns in text containing emoji or combining characters.
Worked example
Pattern cat with g against cat dog cat yields two matches. Positions are string indexes, which need not equal visual columns in text containing emoji or combining characters.
Limitations
- Catastrophic backtracking patterns can stall the browser.
- Compatibility with every server-language regex dialect is not guaranteed.
Fields
| Field | Guidance and constraints |
|---|---|
| Pattern | Check the unit and format displayed beside this field. |
| Flags | Check the unit and format displayed beside this field. |
| Test text | Check the unit and format displayed beside this field. |
Data handling
Processing stays in the current browser tab; the site does not upload tool input for the calculation itself.
Sources
Frequently asked questions
How are two occurrences of cat reported?
Pattern cat with g against cat dog cat yields two matches. Positions are string indexes, which need not equal visual columns in text containing emoji or combining characters.
Will Python necessarily produce the same result?
Catastrophic backtracking patterns can stall the browser. Compatibility with every server-language regex dialect is not guaranteed.
Related tools
You do not need to start over. Continue with the tool that fits your next step.