Something wrong with this tool?
About Regex Tester (JavaScript) Online
This tool tests and visualises regular expression patterns against sample text. Enter your pattern, paste a sample, and the tool highlights every match — showing the matched text, capture groups, and any flags or quantifier behaviour that's affecting the result.
Regex debugging is notoriously painful without immediate feedback. The visualisation eliminates guess-and-check by showing exactly what your pattern matches, what it doesn't, and where each capture group lands. It also explains the pattern as you build it, which helps when learning or sharing regex with others.
The tool supports JavaScript, Python, Perl, and PCRE regex flavours so you can pick the one that matches your runtime. It also generates code snippets in those languages so you can copy your tested regex directly into your codebase.
How to use this tool
How to test a JavaScript regular expression
Enter the pattern
"Regular expression" takes a JavaScript (ECMAScript) regex source — without the surrounding `/.../`. Up to 2,000 characters. Execution is capped server-side for safety against catastrophic backtracking.
Pick flags
"Flags" accepts any combo of `g i m s u y` (default `g`). `g` = global, `i` = case-insensitive, `m` = multiline anchors, `s` = dotAll, `u` = unicode, `y` = sticky. Up to 12 chars total.
Provide test input
"Test string" is the text to match against. Up to 400,000 characters — plenty for most logs and source files.
Press Run
Result returns the list of matches with capture groups, the full text marked with match positions, and metadata like total match count and time. Catastrophic patterns are aborted with a clear error rather than a server-side hang.