Pivotal Knowledge Base

Follow

Using Regular Expressions in PivotalVRP

This guide applies to regular expression use in the PivotalVRP rules engine.

What are Regex's used for in PivotalVRP

The PivotalVRP Rules engine allows you to enter regular expression in certain fields in order to extend the triggering functionality of the rules engine module.
It allows you to easily define what or who NOT to trigger or affect with the rule.

How does it work ?

In any rule definition window , next to certain fields you have a Regex/Literal radio button.

Once you select Regex, the rule will work according to the defined entry.

Regex/Literal selection buttons within the General Rule Threshold window.

Examples

Example 1:

In order to exclude a rule from activating when “vip” tables are being accessed, we apply it to any SQL that doesn’t have “vip” in its text.

The regex input for it would be: ^((?!vip).)*$

“vip” regex sample

Example 2:

In order to trigger the rule when the user name is tom, bill or john the trigger is defined as shown below.

The regex input for it would be: tom | bill | john

“tom | bill | john” regex sample

Example 3: 

If you want to capture everything except a specific schema named ABC you would enter it as shown below.

The regex input for it would be: \b(?!(?:[Aa][Bb][Cc])\b)[\w']+\b

Everything except ABC schema regex sample

 

The use of regular expressions within the PivotalVRP rules adds flexibility to the triggers and expands the functionality of the smart rules engine.

When using Regex users should verify that the syntax being used is correct.  Incorrect syntax use will result in the rule not functioning, added load on the VRP engine and errors in the runtime log.

It is important to verify that the Regex radio button is selected when using regular expressions.

This feature enables the users to combine several “triggers” under the same rule.

 

 

Comments

Powered by Zendesk