Regular expression syntax in Internet Service Monitoring
Regular expressions perform string matching on content downloaded during service tests. These expressions may contain one or more regular expression operators, which determine what content is matched by the expression.
Character |
Description |
---|---|
. |
Matches any single character. For example the regular expression r.t matches the strings rat, rut, r t, but not root. |
$ |
Matches the end of a line. For example, the regular expression dog$ matches the end of the string it's a dog but not the string There are a lot of dogs. |
^ |
Matches the beginning of a line. For example, the regular expression ^When in matches the beginning of the string When in the course of human events but would not match What and When in the. |
* |
Matches zero or more occurrences of the character immediately preceding. For example, the regular expression .* matches any number of any characters. |
\ |
Treats the subsequent character as an ordinary character. For example, \$ matches the dollar sign character ($) rather than the end of a line. Similarly, the expression \. matches the period character rather than any single character. |
[] |
Matches any one of the characters between the brackets. For example, the regular expression r[aou]t matches rat, rot, and rut, but not rit. Specify ranges of characters by using a hyphen. For example, the regular expression [0-9] matches any digit. You can also specify multiple ranges. For example, the regular expression [A-Za-z] matches any upper or lower case letter. |
| |
Matches phrases containing either of the conditions specified. For example him|her matches the line it belongs to him and the line it belongs to her, but does not match the line it belongs to them. |