Regex Tester
Test regular expressions with live match highlighting and capture group inspection.
Flags: g, i, m, s explained
The g (global) flag finds all matches instead of stopping at the first one. The i flag makes matching case-insensitive. The m (multiline) flag makes ^ and $ match the start and end of each line rather than the full string. The s (dotAll) flag makes . match newline characters ( ), which it normally skips. Combining flags like gi is common for case-insensitive global search.
Capture groups and named groups
Wrap part of a pattern in parentheses to create a capture group: (\d+) captures digits. The captured text appears in $1, $2, etc. Named groups (?<year>\d{4}) give the capture a label accessible via the match.groups object. Non-capturing groups (?:...) group for quantifiers without capturing. This tool shows all captured groups below each match.
Common regex patterns for developers
Email validation: ^[\w.-]+@[\w.-]+\.[a-z]{2,}$. UUID: [0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12}. ISO date: \d{4}-\d{2}-\d{2}. IP address: (\d{1,3}\.){3}\d{1,3}. Semantic version: \d+\.\d+\.\d+. These are starting points — production validation usually needs stricter patterns or a dedicated library.