hthai

regexp and pattern matching question

Discussion created by hthai on Jan 28, 2009
Latest reply on Feb 3, 2009 by hthai
Hi,

(1) I defined the following in my nas 3.22 Message

/^WIT\-(?!(.*WebTrans|.*Error\sFunction))/

The above works with anything starts with WIT but does not contain WebTrans or Error Function as part of the WIT string

e.g.
WIT-HELLO-WORLD: this is a test -> Expression matches the target string!

WIT-HELLO-WORLD-WebTrans: this is a test ->
Expression does NOT matches the target string!

WIT-HELLO-WORLD: this is a an Error Function test -> Expression does NOT matches the target string!

WIT-HELLO-WORLD: this is a an Function test -> Expression matches the target string!

(2) So all of the above works pretty well as expected.  Now I also need to expand the current Message rule with an additional filter to omit anything starts with DAATS but does not contain Database or DumpTrans or Error Function as part of the DAATS strings

e.g.
DAATS-HELLO-WORLD: this is a an Function test -> Expression matches the target string!

DAATS-HELLO-WORLD-DumpTrans: this is a test ->
Expression does NOT matches the target string!

DAATS-HELLO-WORLD: this is a an Error Function test -> Expression does NOT matches the target string!

(3) How do I modify my current filter /^WIT\-(?!(.*WebTrans|.*Error\sFunction))/ to include an additional filter for DAATS in (2)?

Thanks,
Hoang

Outcomes