Configuration Management 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.
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)).*
This section explains the syntax used for the preceding example.
.*
" matches 0 or more of any character (such as tabs, whitespace characters, keywords)255
" matches the first octet of the submask. \.
" (escaped dot character) matches the octet separator literal.(?!(255))
excludes matches with the literal string "255
" for indicating the second octet in the subnet.