Test and debug regular expressions with instant match results
Regular expressions (regex) are powerful pattern-matching tools used in programming to search, extract, and manipulate text. They use special characters and syntax to define search patterns that can match strings of characters.
Regular expressions are widely used for data validation, text processing, log analysis, and search-and-replace operations. They provide a concise and flexible way to identify patterns in text.
g
i
m
\\d
- Any digit (0-9)\\w
- Word character (a-z, A-Z, 0-9, _)\\s
- Whitespace character.
- Any character except newline+
- One or more*
- Zero or more?
- Zero or one{n}
- Exactly n times^
- Start of line$
- End of line\\b
- Word boundary[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}
Matches: one or more valid characters, followed by @, domain name, and 2+ letter extension.
\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})
Captures area code, exchange, and number with flexible formatting.
https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)
Matches HTTP/HTTPS URLs with optional www prefix and various path formats.
^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d@$!%*?&]{8,}$
Requires at least 8 characters with lowercase, uppercase, and digit.
([0-9]{4})-([0-9]{2})-([0-9]{2})
(?=.*password)
(?:http|https)://