Regular Expression Pattern
The pattern element is used to add regular expressions to a regular expression post-processor. Each pattern specifies a single expression to search for, and a category that defines the severity of any matching features. To simplify the exclusion of false positive matches, each pattern can also contain exclusion expressions. When a line is found to match a pattern, each exclusion pattern specified is also tested against that line. The line is only added as a feature if none of the exclusion patterns match.
 | Escaping
Note that as the dollar sign character ($) and backslash character (\) have special meanings both in Pulse files and in regular expressions, you must take care when writing expressions that include these characters. See Escaping in Regular Expressions for details. |
Attributes
| Attribute |
Description |
Required |
Default |
| category |
One of "error", "info" or "warning", specifying the severity of features that match this pattern. |
No |
error |
| expression |
The regular expression to search for, in the syntax used by the java.util.regex package (very similar to Perl regular expressions). |
Yes |
|
| summary |
If specified, features created by matching this pattern will have the summary given. By default, the entire matched line is added as the feature summary. If a custom message is desired, use this attribute to provide it. The summary specified may include references to groups in the original expression (see the example below). Note that custom summaries are likely to cause confusing summaries if leading and/or trailing context is also captured. |
No |
the matched line |
Child Elements
| Element |
Description |
Number |
| exclude |
Specifies an exclusion pattern for suppressing false positives. |
0 or more |
Examples
A pattern that searches for test failures and creates features with a custom summary:
<regex.pp name="test.pp">
<pattern category="error" expression="^=== FAILURE: case (.*).\\$" summary="Test case \$1 failed"/>
</regex.pp>
See also regex.pp.