MIGRATED-PAGES‎ > ‎

Regular Expressions for Rules[MIGRATED]

All membership campaigns are organized into various campaigns. User can create these campaign in advance, and specify the rules and so on. As there may be multiple concurrent campaigns, the system will sort the order and priority of these campaigns according to the campaign code. Some users use 900-default, 800-christmas or some other 3-4 characters prefix to the campaign codes to organize these campaigns.

Inside each campaign, users could define various rules within each campaign. Each rule is independent of other rules, and will match the criteria specified for item codes and item categories. Some useful regular expressions as below:

Example Regular Expressions

Matches

Descriptions

.*

Everything

"." is a single character wild card, while "*" means unspecified number of ".", so a combination of these 2 wild cards, means any characters any number of times.

HDD|KYB

"HDD" -> true

"KYB" -> true

"ABC" -> false

"" -> false

Sometimes, we decide that any item code that belongs to HDD and KYB at category 1 will enjoy certain membership rewards, then users should specify the following inside the rules filter:

ITEM-CODE: .*

CATEGORY1: HDD|KYB

CATEOGRY2: .*

CATEGORY3: .*

CATEGORY4: .*

CATEGORY5: .*

(HDD)?(KYB)?

HDD -> true

KYB -> true

ABC -> false

"" -> true

This regular expression is used to specified "Optional" words. So, if the field is empty, it will also return true.




More tutorial on regular expressions are available at http://www.regular-expressions.info/tutorial.html

When the point of sales staff select a campaign, the system will automatically check each

Comments