Regex Tester
Type a pattern and some test text — matches highlight live as you type.
What this tool does
This tool runs a regular expression against sample text using your browser's native RegExp
engine — the same engine that powers String.prototype.match and .replace
in JavaScript — and highlights every match live as you type. Toggle the global, case-insensitive,
multiline, and dot-matches-newline flags to see how each one changes what matches. Everything runs locally
in your browser.
Example use case
Before dropping a regular expression into validation code, a build script, or a find-and-replace, it's worth confirming it actually matches what you expect — and only what you expect. Pasting a pattern like an email or phone number matcher here against a block of real sample text quickly surfaces both false negatives (things it should match but doesn't) and false positives (things it matches but shouldn't).
Common flags
The global flag finds every match instead of stopping at the first one, which is almost always what you
want when testing. Case-insensitive matching ignores letter case. Multiline mode changes ^
and $ to match the start and end of each line rather than the whole string, and dot-matches-newline
lets . match line break characters it would otherwise skip.