Regex Tester
Test a regular expression against sample text with live match highlighting.
What is the Regex Tester?
This tool lets you write a JavaScript regular expression, apply flags, and instantly see every match highlighted inside your sample text, along with a table listing each match, its capture groups, and its position in the string.
How to use it
- Type your pattern into the regular expression field (without the surrounding slashes).
- Toggle flags:
gfinds every match instead of just the first,iignores letter case,mchanges how^and$behave across lines, andslets.match newline characters. - Edit the test string and watch matches highlight live, with details in the table below.
Regular expressions are a compact, powerful way to search, validate or extract patterns from text — email addresses, phone numbers, log lines — but they're notoriously easy to get subtly wrong. Seeing exactly which parts of real sample text a pattern does and doesn't match, updated as you type, is far faster than testing by trial and error inside actual code. This tool uses your browser's native JavaScript regex engine, so behavior matches exactly what you'd get running the same pattern in a .js file or Node script.