Regular Expression Tester
Test regex patterns with live match highlighting and capture groups
Regex Tester
Regex Tester
//g
Flags
How it works
This tool uses JavaScript's built-in RegExp engine to compile and test your regular expression in real time. Matches are highlighted directly in your test string, and capture group values are displayed in a table. All processing happens entirely in your browser -- no data is sent to any server. You can toggle flags (global, case-insensitive, multiline, dotAll) and use the quick reference to insert common patterns.
Frequently Asked Questions
What is a regular expression?
A regular expression (regex) is a pattern that describes a set of strings. It is used to search, match, and manipulate text. For example, \d{3}-\d{4} matches phone number patterns like 555-1234.
What do the flags g, i, and m mean?
g (global) finds all matches instead of stopping at the first. i (case-insensitive) matches regardless of letter case. m (multiline) makes ^ and $ match the start/end of each line instead of the entire string.
What are capture groups?
Capture groups are parts of a pattern enclosed in parentheses. They extract specific portions of a match. For example, (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date like 2024-01-15.
Why does my regex work differently in different languages?
Regex engines differ between languages. JavaScript does not support lookbehinds in older browsers, Python uses a different syntax for named groups, and some features like atomic groups are not available everywhere. This tool uses JavaScript regex.