Regex Tester
Test regular expressions with real-time matching and highlighting.
About Regular Expressions
A regular expression (regex) is a sequence of characters that defines a search pattern. This tool tests your regex pattern in real time and shows all matches with their positions and captured groups.
How to Use
Enter your regular expression pattern in the top field between the slashes. Type or paste your test string in the text area below. Matches are highlighted in real time with details shown below including match position and capture groups.
Understanding Flags
The g (global) flag finds all matches instead of stopping at the first one. The i (insensitive) flag makes the pattern case-insensitive. The m (multiline) flag makes ^ and $ match the start and end of each line. The s (dotAll) flag makes the dot (.) also match newline characters.
Common Use Cases
Data validation (emails, phone numbers, URLs). Find and replace in text editors and IDEs. Log file parsing and analysis. Web scraping and data extraction. Input sanitization and format checking in web forms.