Regex Creator and JavaScript Tester
Check JavaScript regex patterns against pasted text, highlight matches, and inspect capture groups without sending data away.
RegexCapture groupsLocal
Enter a pattern and run the test.
How this tool helps
A regex tester is useful when a search rule needs to be precise before it goes into code, a spreadsheet cleanup, an editor find-and-replace, or a validation rule. This page runs JavaScript regular expressions directly in your browser, so the pattern and test text stay on your device while you experiment.
How to use it
- Paste the text you want to search, including realistic spacing, punctuation, and line breaks.
- Enter the pattern without the surrounding slashes, then enable the flags that match your target environment.
- Review the highlighted matches and the capture-group table before copying the expression into production code.
Practical tips
- Escape literal dots, brackets, question marks, and plus signs when you want the character itself instead of regex behavior.
- Use the multiline flag when anchors should apply to each line; without it, ^ and $ refer to the full text.
- Test with examples that should fail as well as examples that should match, because a regex that matches too much is often the real bug.
FAQ
Why does my regex only show one match?
Enable the global flag when you want every match returned instead of only the first match.
Are these JavaScript regular expressions?
Yes. The tester uses the browser RegExp engine, so syntax should match modern JavaScript behavior.
Can I test private text here?
The matching runs locally, but avoid pasting secrets or regulated data unless you are comfortable handling it in your browser.