Extension:AbuseFilter

Format of rules
A rule may be a single condition, or a group.

Single Conditions

 * [modifier] variable operator parameter


 * modifier is optional (hence the square brackets), and preprocesses ("modifies") the variable in some way before it is compared with the operator. Examples of modifiers are "norm" and "length", which are "normalise", and "length" respectively. See for more details.
 * variable is a variable, which is compared with the parameter using the operator. Variables for each request which trigger a filter are viewable on the details page for an abuse log entry.
 * operator is used with the parameter to match the variable. Examples of operators are "eq" and "lt": equals and less than respectively.
 * parameter is what you compare the variable with.

An example of a singular condition: length USER_NAME gt 30 matches usernames with more than 30 characters.

Modifiers

 * norm &mdash; Normalises the text, removing double-letters, non-alphanumeric characters, and spaces.
 * supernorm &mdash; Super-normalisation. As above, and puts the letters in alphabetical order.
 * lcase &mdash; Converts the string to lower-case.
 * length</tt> &mdash; Returns the length of the string.
 * specialratio</tt> &mdash; Returns the fraction (on [0,1]) of the string which is non-alphanumeric.

Operators

 * eq</tt> &mdash; Returns true if the value is equal to the parameter.
 * neq</tt> &mdash; Returns true if the value is not equal to the parameter.
 * gt</tt> &mdash; Returns true if the value is greater than the parameter.
 * lt</tt> &mdash; Returns true if the value is less than the parameter.
 * regex</tt> &mdash; Returns true if the value matches the parameter (which is a regex).
 * contains</tt> &mdash; Returns true if the value contains the parameter.

Groups of conditions

 * (join condition: rule 1;rule 2; ... ; )</tt>


 * join condition</tt> is either &</tt> (and), |</tt> (or), or !</tt> not. This represents whether the rule is matched if and only if all (and), at least one (or), or no (not) sub-rules are matched.
 * Each rule can be either a single condition or a group.
 * Note that a semicolon is required after the last rule.

Example:
 * (&: USER_EDITCOUNT lt 50; length USER_NAME gt 10; )</tt>

Matches users whose editcount is less than 50, and whose name is longer than ten characters.