Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Using Event Filters | Filter Strings | Using Regular Expressions
 
Using Regular Expressions
Regular expressions allow you to specify a complex pattern that is to be matched with an input string. The regexpMatch filter function accepts a regular expression as an argument.
A regular expression is made up of one or more basic components called atoms. An atom is used to match a single character in the input string or it can represent multiple occurrences of one or more characters.
If each atom in a regular expression matches a corresponding element in the input string, the expression is said to match the input string.
Character(s)
Matches
.
Any single character in the input string.
^
A null string at the start of the input string.
$
A null string at the end of the input string.
\x
The character x. A special character that you wish to match in the input string may be escaped in this manner, such as \^ or \$.
[chars]
Any single character from chars.
Specifying [a-z] will match any input string containing all lowercase characters. Specifying [0-9a-fA-F] will match any input string containing hexadecimal digits.
If a ] character appears as the first characters in chars, it will be treated literally instead of as a terminator.
[^chars]
Any single character that is not contained in chars.
(regexp)
Any input string that matches regexp. Parentheses can be used to create complex regular expressions.
*
A sequence of 0 or more of the preceding atom.
+
A sequence of 1 or more of the preceding atom.
?
Either a null string or the preceding atom.
regexp1|regexp2
Anything that matches either regexp1 or regexp2. Note that the | delimiter cannot be proceeded by or followed by a blank.