Developer Tools
Regular Expression Tester
Test a JavaScript regular expression against text and inspect its matches.
Your input is processed in this browser and is not sent to our server.
How to Use Regex Tester
- Enter a JavaScript regular-expression pattern and optional flags.
- Paste test text.
- Select Test expression and inspect each match and its position.
Example
Input
Pattern: \\b\\w+\\b; flags: g; text: red blue
Result
Two matches: red at index 0 and blue at index 4.Common Errors & Troubleshooting
- Escape backslashes when entering them in a pattern.
- Invalid syntax or duplicate flags are reported by the browser regular-expression engine.
Frequently Asked Questions
Which regular-expression syntax is used?
The tester uses JavaScript RegExp syntax and supports flags accepted by the current browser.
Does the tester change the input text?
No. It reports matches and positions without modifying your text.