NETCOOL regular expression library
If your system supports single-byte character languages, you can use the NETCOOL regular expression library to run search queries on your data. The NETCOOL library provides better system performance than the TRE regular expression library.
For example, to escape the parentheses
in the string '1_(22)'
, use this expression: '1_\\(22\\)'
.
The NETCOOL regular expression library supports the use of normal characters and metacharacters. The following table describes the set of metacharacters supported by the NETCOOL regular expression library.
Metacharacter | Description | Examples |
---|---|---|
* |
Matches zero or more instances of the preceding atom. Matches as many instances as possible. | goo* matches my godness , my
goodness , and my gooodness , but not my
gdness . |
+ |
Matches one or more instances of the preceding atom. Matches as many instances as possible. | goo+ matches my goodness and my
gooodness , but not my godness . |
? |
Matches 1 or zero instances of the preceding atom. | colou?r matches color and
colour .
|
$ |
Matches the end of the string. | end$ matches the end , but
not the ending . |
^ |
Matches the beginning of the string. | ^severity matches severity level 5 ,
but not The severity is 5 . |
. |
Matches any single character. | b.at matches baat , bBat ,
and b4at , but not bat or bB4at . |
[abcd] |
Matches any character in the square brackets. | [nN][oO] matches no , nO , No ,
and NO .
|
[a-d] |
Matches any character in the range of characters separated
by a hyphen (- ). |
[0-9] matches any decimal digit.
|
[^abcd]
|
Matches any character except those in the square brackets or
in the range of characters separated by a hyphen (- ). |
[^0-9] matches any string that does not contain
any numeric characters. |
() |
Indicates that the characters within the parentheses should be treated as a character pattern. | A(boo)+Z matches AbooZ , AboobooZ ,
and AbooboobooZ , but not AboZ or AboooZ .
|
| |
Matches one of the atoms on either side of the pipe character. | A(B|C)D matches ABD and ACD ,
but not AD , ABCD , ABBD ,
or ACCD .
|
\ |
Indicates that the metacharacter following should be treated as a regular character. The metacharacters listed in this table require a backslash escape character as a prefix to switch off their special meaning. | \* matches the * character.
|