User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
User:松/Drafts/Extension:AbuseFilter/Rules format (view source)
Revision as of 13:42, 14 August 2020
, 3 years ago→Functions
(→Notes) |
|||
Line 677:
| <code>get_matches</code> || {{MW version-inline|MW 1.31+}} Looks for matches of the regex needle (first string) in the haystack (second string).Returns an array where the 0 element is the whole match and every <code>[n]</code> element is the match of the n'th capturing group of the needle.Can be made case-insensitive by letting the regular expression start with "(?i)".If a capturing group didn't match, that array position will take value of ''false''.
|-
| <code>ip_in_range</code> || Returns true if user's IP (first string) matches the specified IP range (second string, in [[:
|-
| <code>contains_any</code> || Returns true if the first string contains '''any''' string from the following arguments (unlimited number of arguments in logic OR mode).If the first argument is an array, it gets casted to string.
|