E.3 Hints on using regular expressions
-
The control codes (such as linefeed and tab) might be handled differently depending on the product and OS. If you use regular expressions to specify conditions for messages, specify the part that does not include control codes.
-
If you make frequent use of the regular expression .* for matching all characters, the search processing might take a long time. If you use .* for long messages, use it only at the necessary locations.
In an environment that supports extended regular expressions, you can use [^ ]* instead of .* to match characters other than the space, which will reduce the search processing time.
-
The | special character represents the OR condition. Note the following about using this OR condition in regular expressions:
The | special character for the OR condition has a low priority in a regular expression, which means that you must specify explicitly the range of the OR condition. If you do not specify the range, the OR condition might not work or might malfunction. Specify the range of an OR condition by enclosing the range in parentheses ( ).
The following example selects those NNMi incidents whose source node includes gyoumu or host:
SRC_NODE_NAME REGEX ^.* (gyoumu|host) .*$
-
Any space that is specified before or after the | special character is treated as a character. If you do not intend to include spaces, do not specify them in conjunction with the | special character.