newline \n tab \t form feed \f - octal char \000 hexadecimal char \x00 wide hexadecimal char \x{0000} control char ^A \cA - any character . word character \w non-word char \W whitespace char (\t, \n, \v, \f, \r, \x20) \s non-whitespace char \S digit char \d non-digit char \D - 1 or 0 times ? 1 or 0 times (reluctant) ?? 0 or more times ? 0 or more times (reluctant) *? 1 or more times + 1 or more times (reluctant) +? at least n but not more than m times {n,m} at least n but not more than m times (reluctant) {n,m}? n times {n} n times (reluctant) {n}? - beginning of the line ^ end of the line $ word boundary \b not word boundary \B beginning of string \A end of string, or before newline at the end \Z end of string \z previous end-of-match position \G - comment (?#...) option on/off (?imx-imx) option on/off for subexp (?imx-imx:subexp) not captured group (?:subexp) look-ahead (?=subexp) negative look-ahead (?!subexp) look-behind (?<=subexp) negative look-behind (?<!subexp) atomic group (?>subexp) define named group (?<name>subexp)