Regex Tester

Test regular expressions with live match highlighting, capture groups, replace mode, and a common patterns library. Includes a catastrophic-backtracking guard — patterns that freeze execution time out at 50ms. Runs entirely in your browser.

Runs entirely in your browser. Your data never leaves this page.
Pattern
//g
Test String

How the Regex Tester Works

All matching runs through the browser's native RegExp engine — no external library. The catastrophic-backtracking guard wraps exec() in a deadline check: if the loop hasn't completed within 50ms, it stops and shows a warning. Patterns like /(a+)+$/ applied to a long string of 'a's are classic examples that can freeze a browser — this guard catches them.

Replace mode uses String.prototype.replace(regex, replacement) and supports capture group references like $1, $2, named groups via $<name>, and the matched string itself as $&.

Live Matching
Results update as you type. Each match color-coded, position shown.
Backtracking Guard
50ms timeout stops runaway regexes before they freeze the tab.
100% Private
No server calls. Pattern and test string never leave your browser.