Regex Tester
Enter a pattern and test text; lists every match position and capture group.
What this tool does
Enter a regular expression and a test string; all matches are highlighted in real time, with capture groups listed for each match. Common flags are supported — i (case-insensitive), g (global), m (multiline). Feedback is instant, shrinking the write-a-regex loop from minutes to seconds.
Typical use cases
Extracting IPs, timestamps, or error codes from logs; validating form input (emails, phone numbers, URLs); batch renaming or replacing patterned text; pulling fields out of HTML or config files. Get the expression right here first, then paste it back into code — far faster than trial-and-error in a running program.
Common pitfalls
Greediness is the number-one trap: .* consumes as much as possible, often swallowing whole sections; most of the time you want the lazy .*?. Next is catastrophic backtracking: nested quantifiers like (a+)+ degrade exponentially on certain inputs (ReDoS) — dangerous in production services. Finally, dialects differ: this tool follows JavaScript syntax, which behaves differently from Java, Python, or PCRE — some Unicode features require the u flag, for example.