() # parenthesis
*+?{} # counters
/.../ ^$\b # sequences and anchors
| # disjunction
* # >=0 occurences of the previous char or expression
+ # >=1 occurences of the previous char or expression
? # 0/1 occurence of the previous char or expression (optional indicator)
{n} # n occurences of the previous char or expression
{n,m} # from n to m occurences of the previous char or expression
{n,} # at least n occurences of the previous char or expression
/word/ # matches the first occurence of pattern "word"
. # single occurence of any character (wildcard character)
/pref.*suf/ # matches any sequence preceeded by "pref" and ended with "suf"
\* # asterisk
\. # period
\? # question mark
\n # newline
\t # tab
\d # any digit. Shorthand for [0-9]
\D # any non-digit. Shorthand for [^0-9]
\s # any space delimiter. Shorthand for [_\r\t\n\f]
\S # any non-whitespace. Shorthand for [^\s]
/[wW]ilson/ # matches "Wilson" or "wilson". Or equivalently /(w|W)ilson/
/[abc]/ # matches "a" or "b" or "c"
/[1234567890]/ # matches any digit. Shorthand: /[0-9]/
/[A-Z]/ # matches an upper-case character
/[a-z]/ # matches a lower-case character
[^A-Z] # do not match an upper-case character
[^Ss] # matches neither "S" nor "s"
[^\.] # do not match period
Note:
[e^] # matches either "e" or "^"
a^b # matches pattern "a^b"
/a*/ # matches zero or more "a"s
/aa*/ # matches one of more "a"s. Or equivalently /a+/
/[ab]*/ # matches patterns like "aaaa", "abab", "bbba" etc.
^ # start of a line
$ # end of a line
\b # word(any sequence of digits, underscores or letters) boundary
Usage:
/^The dog\.$/ # match a line containing only "The dog."
/\bthe\b/ # match "the" but not "other"