Reg-expr | Description -----------+--------------------------------------------------- . | Matches any character (except newline) ^ | Matches the start of the string $ | Matches the end of the string x? | Matches 0 or 1 x's, where x is any regular expression x* | Matches 0 or more x's x+ | Matches 1 or more x's foo|bar | Matches one of foo or bar [xyz] | Matches any character in the set xyz, specify ranges with a - [^xyz] | Matches any single character not in the set xyz \w | Matches an alpha-numeric character, i.e., [a-zA-Z0-9_] \s | Matches a whitespace character \b | Matches a word boundary (x) | Brackets a regular expression \metachar | Matches the metacharacter (takes away its special meaning)
hello
matches the string
"hello".
(foo)?bar
matches the strings "bar" and "foobar".
ex*tra
matches the strings "etra",
"extra", "exxtra", "exxxtra" ...
Full details on Perl regular expressions can be found in the Perl manual.