Extension:AbuseFilter/Rules format/mr

The rules are formatted much as conditionals in a C/Java/Perl-like language.

लिटरल्स Literals
You can specify a literal by placing it in single or double quotes (for strings), or by typing it in as-is (for numbers, both floating-point and integer). You can get linebreaks with \n, tab characters with \t, and you can also escape the quote character with a backslash. "This is a string" 'This is also a string' 'This string shouldn\'t fail' "This string\nHas a linebreak" 1234 1.234 -123
 * उदाहरणे:

चल (व्हॅरिएबल्स) Variables
The abuse filter passes various variables by name into the parser. These variables can be accessed by typing their name in, in a place where a literal would work. You can view the variables associated with each request in the abuse log. USER_EDITCOUNT ARTICLE_RECENT_CONTRIBUTORS
 * उदाहरणे:

Action variable can be,  ,   or.

You can define more variables for ease of understanding with the assign symbol := in a line (closed by ;) within a condition. उदाहरण(from w:en:Special:AbuseFilter/79): (line1:="(\{\{(r|R)eflist|\{\{(r|R)efs\}\}| (plus) symbol to concatenate two literal strings or the values of two vars with a string value.

सूचक शब्द Keywords
The following special keywords are included for often-used functionality:
 * like returns true if the left-hand operand matches the glob pattern in the right-hand operand.
 * in returns true if the right-hand operand (a string) contains the left-hand operand.
 * rlike and regex return true if the left-hand operand matches (contains) the regex pattern in the right-hand operand. The system uses PCRE.

"1234" like "12?4" परिणाम: True "1234" like "12*" परिणाम: True "foo" in "foobar" परिणाम: True "foo" regex "\w+" परिणाम: True
 * उदाहरणे:

कार्ये Functions
A number of built-in functions are included to ease some common issues. They are executed in the general format functionName(arg1,arg2,arg3)</tt>, and can be used in place of any literal or variable. Its arguments can be given as literals, variables, or even other functions.


 * Other:
 * convert</tt> returns the second argument converted to variant language specified by the first argument. ONLY apply on wikis with LanguageConverter class. (New func added on 49399, need support of MediaWiki after 49397)

length("Wikipedia") परिणाम: 9 lcase("Wikipedia") परिणाम: wikipedia ccnorm("ωɨƙɩᑭƐƉlα") परिणाम: W1K1PED1A convert("zh-hant", "维基百科") // assume we work on a wiki with Chinese LanguageConverter class परिणाम: 維基百科 rmdoubles( "foobybboo" ) परिणाम: fobybo specialratio("Wikipedia!") परिणाम: 0.1 norm( "!!ω..ɨ..ƙ..ɩ..ᑭᑭ..Ɛ.Ɖ@@l%%α!!" ) परिणाम: W1K1PED1A count( "foo", "foofooboofoo" ) परिणाम: 3 count( "foo,bar,baz" ) परिणाम: 3 rmspecials( "FOOBAR!!1" ) परिणाम: FOOBAR1
 * उदाहरणे:

बुलियन (गणनद्वैत) कार्ये Boolean operations
You can match if and only if all of a number of conditions are true, one of a number of conditions are true, or one and only one of all conditions are true.
 * x | y</tt> &mdash; OR – returns true if one or more of the conditions is true.
 * x & y</tt> &mdash; AND – returns true if both of the conditions are true.
 * x ^ y</tt> &mdash; XOR – returns true if one, and only one of the two conditions is true.
 * !x</tt> &mdash; NOT – returns true if the condition is not true.

1 | 1 परिणाम: True 1 | 0 परिणाम: True 0 | 0 परिणाम: False
 * उदाहरणे:

1 & 1 परिणाम: True 1 & 0 परिणाम: False 0 & 0 परिणाम: False

1 ^ 1 परिणाम: False 1 ^ 0 परिणाम: True 0 ^ 0 परिणाम: False

!1 परिणाम: False

कामांचा क्रम Order of operations
Operations are generally done left-to-right, but there is an order to which they are resolved. As soon as the filter fails one of the conditions, it will stop checking the rest of them and move on to the next filter. The evaluation order is:
 * 1) Anything surrounded by parentheses ((</tt> and )</tt>) is evaluated as a single unit.
 * 2) Turning variables/literals into their respective data. (i.e., article_namespace</tt> to 0)
 * 3) Function calls (norm</tt>, lcase</tt>, etc.)
 * 4) Unary + and - (defining positive or negative value, e.g. -1234</tt>, +1234</tt>)
 * 5) Keywords
 * 6) Boolean inversion (!x</tt>)
 * 7) Exponentiation (2**3 → 8</tt>)
 * 8) Multiplication-related (multiplication, division, modulo)
 * 9) Addition and subtraction (3-2 → 1</tt>)
 * 10) Comparisons. (<tt><</tt>, <tt>></tt>, <tt>==</tt>)
 * 11) Boolean operations. (<tt>&</tt>, <tt>|</tt>, <tt>^</tt>, <tt>in</tt>)

उपयोगी दुवे

 * PCRE pattern syntax.

zh:Wikipedia:防滥用过滤器/操作指引