Regex Tester (JavaScript)
Test regular expressions live. See matches highlighted, capture groups, and a replace preview. Runs with a time limit.
How to use Regex Tester
Step by step
Type a pattern
Enter the regular expression without slashes, then choose flags.
Paste test text
Matches are highlighted as you type.
Check groups and replace
See capture groups and preview a replacement.
Features and benefits
What you get
Live highlighting
Matches are marked in your text as you type.
Capture groups
Numbered and named groups are listed for each match.
Time limit
Slow patterns are stopped after 2 seconds.
Private
Runs entirely in your browser.
Supported formats and limitations
What to expect
Supported formats
JavaScript regular expressions
Size limits
Limited by browser memory
Limitations
Uses the JavaScript regex engine. Other languages (PCRE, Python, .NET) have small differences. Shows up to 1,000 matches.
Frequently asked questions
Quick answers
Which regex flavour is used?
JavaScript (ECMAScript), the same as the RegExp object in your browser.
Why is my pattern stopped?
Some patterns, for example nested repeats like (a+)+, can take exponential time. The tester stops them after 2 seconds.
Related tools
More from Developer Tools
JSON Formatter
Format, indent, sort and minify JSON. Invalid JSON is reported with the line and column of the problem.
JSON Validator
Check whether your JSON is valid. If it is not, see the exact line and column and a plain-English reason.
HTML Formatter
Indent and tidy HTML. Inline tags stay on the line, and embedded CSS and JavaScript are formatted too.
Related guides
Read more about this tool