Regular expressions are strings that can contain any of the following special wildcard characters:
. |
Matches any single character. For example, |
( ) |
Used to force precedence of operators (for example, +) when the default precedence
is not desired. For example, concatenation of characters (for example, the) precedes
other operators such as +, so that |
[ ] |
Matches any one of the single characters in the brackets. The brackets
are a logical OR operator. For example, |
| |
Used between two regular expressions. Matches if either regular expression matches. |
\ |
Matches the special character that follows the backslash. For example,
Some special uses of the escape character are:
|
* |
Matches 0 or more instances of the regular expression. For example,
|
+ |
Matches 1 or more instances of the regular expression. For example,
|
These characters have special meaning between square brackets:
~ |
As the first character, matches any characters not found in the characters
or ranges inside the brackets. For example, |
|
Between character pairs, matches any characters in the range. For example,
|
|
You can also use the escape character between brackets. |
The order of precedence of the regular expression special characters is as follows: ( ), [ ], concatenated characters (for example, abc), *, +, ~, , |, .
The following examples show some of the implications of the order of precedence:
Copyright © 1984, 2005, Oracle. All rights reserved.