Regex Tester
Welcome to the Regex Tester tool! Test, learn, and experiment with regular expressions in real-time. Use this tool to validate regex patterns, see matches, and gain a better understanding of how regular expressions work.
Matches
- No matches found.
Common Patterns
- \dMatches any digit (0-9).
- \wMatches any word character (a-z, A-Z, 0-9, _).
- \sMatches any whitespace character.
- ^Matches the start of a string.
- $Matches the end of a string.
- .Matches any character except a newline.
- \bMatches a word boundary (e.g., between a word and a space).
- \BMatches a non-word boundary.
- \d+Matches one or more digits.
- \w+Matches one or more word characters.
- \s+Matches one or more whitespace characters.
- \DMatches any non-digit character.
- \WMatches any non-word character.
- \SMatches any non-whitespace character.
- (abc|def)Matches either 'abc' or 'def'.
- (a{2,4})Matches 'a' between 2 and 4 times.
- a{2,}Matches 'a' 2 or more times.
- a{,4}Matches 'a' up to 4 times.
- (\d{3})-(\d{3})-(\d{4})Matches a phone number in the format XXX-XXX-XXXX.
- \b\w+\bMatches any whole word.
- \(?\d{3}\)?[-\s]?\d{3}[-\s]?\d{4}Matches a phone number with optional parentheses and spaces.
- [A-Za-z]Matches any uppercase or lowercase letter.
- [^0-9]Matches any character that is not a digit.
- (?<=@)[A-Za-z0-9]+Matches any word after the '@' symbol (e.g., domain in email).
- (?=\d)Positive lookahead, matches only if there's a digit ahead.
- (?!\d)Negative lookahead, matches only if there's no digit ahead.
- (?<=\d)(?=\w)Positive lookbehind followed by positive lookahead.
- \p{Emoji}Matches any emoji character (Unicode property).
- \p{L}Matches any letter character (Unicode property).
- \p{Number}Matches any numeric character (Unicode property).
- [^\x00-\x7F]Matches any non-ASCII character.
- a{2,4}?zMatches 'a' between 2 and 4 times, non-greedy, followed by 'z'.
- (\d{2,4})-(\d{1,2})-(\d{1,2})Matches a date in YYYY-MM-DD format.