Regex Tester
Test regular expressions in real time with instant match highlighting and capture group display.
Test regular expressions in real time with instant match highlighting and capture group display.
This free online regex tester lets you write and debug regular expressions in real time. As you type your pattern and test string, all matches are instantly highlighted, and capture groups are displayed alongside their index positions. No sign-up is required, and all processing happens locally in your browser, so your data never leaves your device.
Enter a regular expression pattern in the input field at the top. Use the flag checkboxes to toggle global, case-insensitive, multiline, and dotall modes. Paste or type your test string in the textarea below. Matches are highlighted in yellow in the output area, and a detailed list of every match, including capture groups and positions, appears underneath.
If you need a common pattern quickly, use the preset buttons for email addresses, URLs, phone numbers, IP addresses, and dates. Clicking a button populates the regex field so you can start testing immediately. These patterns cover the most frequent validation tasks developers encounter in everyday work.
The g (global) flag finds all matches rather than stopping at the first one. The i flag makes the pattern case-insensitive. The m (multiline) flag treats each line as a separate string for ^ and $ anchors. The s (dotall) flag makes the . character match newlines as well.
Parentheses in a regex create capture groups. When your pattern contains groups, this tool displays each group's value alongside the full match. This is useful for extracting specific parts of a matched string, such as the domain from an email address or the path from a URL.
All regex testing runs entirely in your browser using JavaScript. No data is transmitted to any server. This makes the tool safe for testing patterns against sensitive content such as API keys, personal data, or proprietary text.