Pattern Exclusion

WhatsConfigured regular expression (regex) engine supports both pattern matching and pattern exclusion.

Pattern exclusion is applied using a mechanism referred to as negative look-ahead. It takes this syntax:

(?!(myvalue))

—Where "?!" is the negative lookahead operator.

Return Records Containing String A but not B

Let's say you want to validate changes to your subnet mask across your enterprise 255.255.0.0, but you suspect that some of your routers might have the wrong value for the second octet. Ensure the Regex checkbox is checked.

Syntax

.*255\.(?!(255)).*

Regex Syntax Details

This section explains the syntax used for the preceding example.

See Also

Applying Regular Expressions

Pattern Range (IP Address)