Can the regexp used in a Spectrum Event Condition Rule be configured to be case insensitive?

Document ID : KB000057314
Last Modified Date : 14/02/2018
Show Technical Document Details

QUESTION:  Can the regexp used in a Spectrum Event Condition Rule be configured to be case insensitive?

 

ANSWER:  By default, the regexp used in an Event Condition Rule is case sensitive. The following are the instructions on how to configure the regexp to be case insensitive.

The following is an example of an Event Condition Rule using regexp that was created using the Event Configuration Editor:

0xfff00002 E 0 R CA.EventCondition, "(regexp({v 1}, {S \"Check\"}))" , "0xfff00003 -:-","default" , "0xfff00004 -:-"

In the above example, the Event Condition Rule will look for the word "Check" in event variable 1 of event 0xfff00002. If found, it will generate event 0xfff00003. If not, it will default to generate event 0xfff00004. But what if the word "Check" in event variable 1 could come out as "check" or Check" or CHECK? The way the Event Condition Rule is written above, it will only generate event 0xfff00003 if it matches "Check" exactly. If it comes across as "check" or "CHECK", it will default to event 0xfff00004.

To make the regexp match case insensitive, you will need to manually modify the rule after the initial creation using the Event Configuration Editor. The following is an example of how to configure the above Event Condition Rule to make the regexp match case insensitive:

0xfff00002 E 0 R CA.EventCondition, "(regexp({v 1}, {S \"(?i)Check\"}))" , "0xfff00003 -:-","default" , "0xfff00004 -:-"

Notice the (?i) in front of the word "Check". By adding (?i) in front of the word "Check", it makes the regexp match case insensitive. So, if the word comes across as "Check", "check", "CHECK" or any combination of case, the regexp will result in a true condition and event 0xfff00003 will be generated.