Free Regex Tester
Test and debug regular expressions with live match highlighting.
About this tool
How to use
Frequently Asked Questions
g (global) - find all matches, not just the first. i (case-insensitive) - match regardless of case. m (multiline) - ^ and $ match start/end of each line. s (dotAll) - dot (.) matches newline characters too.
In regex, characters like . * + ? ^ $ { } | ( ) [ ] \ have special meaning. To match them literally, prefix with a backslash. For example, \. matches a literal dot, and \( matches a literal parenthesis.
A capture group is a portion of the pattern in parentheses, e.g. (\d+). It captures the matched text for later use. Named groups use (?<name>pattern) syntax. In Replace mode, you can reference groups with $1, $2, or $<name>.
By default, quantifiers like * and + are greedy - they match as much as possible. Add ? after a quantifier to make it lazy (match as little as possible). For example, <.*?> matches a single HTML tag, while <.*> might match from the first < to the last >.
^ matches the start of the string (or line in multiline mode). \b is a word boundary - it matches the position between a word character and a non-word character. Use \b to match whole words, e.g. \bcat\b matches 'cat' but not 'catch'.
