User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions

m
(→‎Functions: Translation code removal.)
Line 727:
| <code>rcount</code> || Similar to <code>count</code> but the needle uses a regular expression instead.Can be made case-insensitive by letting the regular expression start with "(?i)".Please note that, for plain strings, this function can be up to 50 times slower than <code>count</code><ref>https://3v4l.org/S6IGP</ref>, so use that one when possible.
|-
| <code>get_matches</code> || {{MW version-inline|MW 1.31+}} <translate><!--T:340--> Looks for matches of the regex needle (first string) in the haystack (second string).</translate> <translate><!--T:341--> Returns an array where the 0 element is the whole match and every <tvar|1><code>[n]</code></> element is the match of the n'th capturing group of the needle.</translate> <translate><!--T:342--> Can be made case-insensitive by letting the regular expression start with "<tvar|1>(?i)</>".</translate> <translate><!--T:343--> If a capturing group didn't match, that array position will take value of ''false''.</translate>
|-
| <code>ip_in_range</code> || <translate><!--T:344--> Returns true if user's IP (first string) matches the specified IP range (second string, in [[:en:CIDR notation|CIDR notation]]).</translate> <translate><!--T:345--> Only works for anonymous users.</translate> <translate><!--T:346--> Supports both IPv4 and IPv6 addresses.</translate>
|-
| <code>contains_any</code> || <translate><!--T:347--> Returns true if the first string contains '''any''' string from the following arguments (unlimited number of arguments in logic OR mode).</translate> <translate><!--T:348--> If the first argument is an array, it gets casted to string.</translate>
222

edits