Match Special Characters
|
Example
|
Character
|
|
Group
|
Match
|
[]
|
Encloses characters, including wild cards, to match.
|
abc[*]
|
abc*
|
[
|
Can be enclosed in a match character group.
Note: The right bracket, ] , cannot be used within a group to match itself, but it can be used outside of any brackets as an individual character.
|
[[]abc]
|
[abc]
|
[charlist]
|
Any character that matches one or more enclosed characters.
|
t[io]p
|
Yes
|
tip
top
|
|
Note: The character sequence [] is considered a zero-length string ("").
|
|
No
|
tap
|
[!charlist]
|
Any character that is not enclosed in brackets.
|
t[!io]p
|
Yes
|
tap
|
|
|
|
No
|
tip
top
|
[char-list]
|
(Hyphen) separates the upper and lower bounds of a charlist to identify a range.
|
[0-5]AB
|
Yes
|
0AB
1AB
|
|
Important: When a range of characters is specified, they must appear in ascending sort order (from lowest to highest),
[A-Z] is a valid pattern.
[Z-A] is not a valid pattern.
|
|
No
|
6AB
|
[char-list][char-list]
|
Matches multiple ranges.
|
[A-M][0-5]
|
Yes
|
A1
M5
|
|
Note: There are no delimiters between ranges.
|
|
No
|
N6
A9
Z0
|
[-charlist]
|
Matches itself when it is:
|
[-201]
|
Yes
|
-21
|
|
- At the beginning of a charlist.
|
|
No
|
33
|
|
- After an exclamation point.
|
[ABCD-]
|
Yes
|
ABC-
|
|
|
|
No
|
DEF
|