This shows you the differences between two versions of the page.
Previous revision | |||
— | reference:spamrules_statement_countmatches [2018/11/14 10:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Spam Filter Rules: CountMatches====== | ||
+ | ^Statement | ||
+ | ^Version | ||
+ | ^Purpose | ||
+ | **CountMatches** statements require a data parameter a search value and the name of the variable to place the count into, in the format | ||
+ | CountMatches < | ||
+ | |||
+ | * The < | ||
+ | * The number of times the match occurs is returned into a variable with the name format **${''< | ||
+ | |||
+ | =====Example===== | ||
+ | The following example will scan the body of the incoming message, for the regular expression '/ /' and return the number of matches into the ${numSpaces} variable | ||
+ | < | ||
+ | CountMatches body "/ /" numSpaces | ||
+ | </ |