Quick Regular Expressions reference
\d any decimal digit
\D any char that is not a decimal digit
\s any whitespace char
\S any char that is not a whitespace
\w any word char
\W any non-word char
\b word boundary; backspace inside []
\B not a word boundary
\A start of subject
(independent of multiline mode)
\Z end of subject or newline at end
(independent of multiline mode)
\z end of subject
(independent of multiline mode)
[] char class
^ beginning of line; negate inside []
$ end of line
() capturing parentheses
| alternation
* zero or more time, equals to {0,}
+ one or more time, equals to {1,}
? zero or one time, equals to {0,1}
{m,n} preceding group: min m, max n times
(?:) non-capturing parentheses
(?=x) lookahead (only if followed by x)
(?!x) negated lookahead (only if not followed)
\f form-feed
\t tab
\v vertical-tab
\r carriage return
\n new line (unix:\n, win:\r\n, mac:\r)
\xhh hexadecimal code of char (2 hex)
\uhhhh unicode code of char (4 hex)