Test regular expressions with live matching, highlighting, and capture groups. Real-time validation as you type.
Regular expressions are powerful but the syntax is dense enough that even experienced developers test patterns interactively rather than trusting their memory. Paste your pattern, paste your test string, and see exactly what matches — highlighted in real time.
Your test strings and patterns never leave your device. Safe to use with real log files, customer data, or proprietary formats.
This tester uses JavaScript's built-in RegExp engine, which follows the ECMAScript regex standard. It supports most common regex features including character classes, quantifiers, groups, lookaheads, and lookbehinds. Some features from PCRE (PHP/Python) like possessive quantifiers are not supported.
The 'g' (global) flag finds all matches instead of just the first. The 'i' (case-insensitive) flag makes the pattern match regardless of letter case. The 'm' (multiline) flag makes ^ and $ match the start/end of each line instead of the whole string. The 's' (dotAll) flag makes . match newlines too.
Quantifiers like * and + are greedy by default — they match as much as possible. Add ? after them (e.g., .*?) to make them lazy (match as little as possible). Also check if you need to escape special characters like . ( ) [ ] { } + * ? ^ $ | with a backslash.
Special regex characters must be escaped with a backslash. To match a literal dot, use \. To match a literal parenthesis, use \( and \). To match a literal backslash, use \\.
A capturing group (parentheses: (abc)) captures the matched text so you can reference it in replacements or extract it. A non-capturing group (?:abc) groups the pattern for quantifiers or alternation without capturing. Use non-capturing groups when you do not need the captured value.