Dashboard > Pulse v2.0 > ... > pattern > exclude
  Pulse v2.0 Log In | Sign Up   View a printable version of the current page.  
  exclude
Added by Jason Sankey, last edited by Jason Sankey on Nov 18, 2008  (view change)
Labels: 
(None)

Pulse Manual Index

Exclude Pattern

Exclude patterns can be used to ignore false positive matches when using regular expression post-processors. For example, you may want to use a regular expression to search for the word "Error" in compiler output. This will find compiler errors, but if you also have a source file named MyError.cpp, that filename will be incorrectly detected as an error. It may be possible to modify the original regular expression to avoid false positives, but generally speaking regular expressions do not provide a convenient way to exclude these false positives. It is much simpler to specify an exclusion pattern which will suppress a match if the exclusion pattern itself matches. Continuing the example, you could specify an exclusion expression ".Error.\.cpp" to exclude any .cpp files with "Error" in ther name.

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
expression The expression to exclude, in the format used by the java.util.regex package (very similar to Perl regular expressions). Yes  

Child Elements

None.

Examples

An illustration of the example described above:

<regex.pp name="compiler.pp">
    <pattern category="error" expression="Error">
        <exclude expression=".*Error.*\\.cpp"/>
    </pattern>
</regex.pp>

Zutubi wiki is Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.10 Build:#528 Nov 29, 2006) - Bug/feature request - Contact Administrators