Table 1: Common Regular-Expression Metacharacters


Character

Description

\

Matches the following character literally

.

Matches any single character

^

Matches the beginning of the string

$

Matches the end of the string

[xyz]

Matches any one of the characters between [ ]

[^xyz]

Matches any character not between [ ]

[x-z]

Matches any character in the specified range between [ ]

[^x-z]

Matches any character not in the specified range between [ ]

*

Matches the preceding character or expression zero or more times

+

Matches the preceding character or expression one or more times

{n}

Matches the preceding character or expression exactly n times

( )

Group characters between ( )

$1

Refer to grouped expressions enclosed between ( ) when replacing