Test regular expressions with live highlighting and match details.
Test and debug regular expressions with live syntax highlighting. See every match with its position, use common presets for emails, URLs, and phone numbers, and test replacements with capture group references.
This regex tester uses JavaScript regex syntax. All processing happens in your browser — nothing is sent to any server.
This tool uses JavaScript (ECMAScript) regular expressions, which are supported by all modern browsers, Node.js, and many other languages.
g = find all matches (not just the first), i = case-insensitive, m = treat ^ and $ as line boundaries, s = make . match newlines too.
Use $1, $2, etc. to reference captured groups. Named groups use $<name>. $& inserts the entire match. $` and $' insert text before/after the match.
Enter your regular expression pattern and test string. Matches are highlighted in real time as you type. Toggle flags (global, case-insensitive, multiline) and use the replace mode to test substitution patterns. The presets library provides common patterns for emails, URLs, phone numbers, and more.
Regular expressions are powerful but notoriously difficult to get right. A small mistake in a regex pattern can match too much, too little, or cause catastrophic backtracking that freezes your application. Testing patterns with real data before putting them in code prevents bugs, data loss, and performance issues.
This tester highlights every match in context, shows capture groups, and counts total matches — giving you confidence that your pattern does exactly what you intend before you deploy it.
After extracting data with regex, clean it up with Remove Duplicate Lines.