User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
User:松/Drafts/Extension:AbuseFilter/Rules format (view source)
Revision as of 13:16, 13 August 2020
, 3 years ago→Functions: Translation code removal.
(→Functions: Translation code removal.) |
(→Functions: Translation code removal.) |
||
Line 709:
| <code>norm</code> || Equivalent to <code>rmwhitespace(rmspecials(rmdoubles(ccnorm(arg1))))</code>.
|-
| <code>ccnorm</code> || Normalises confusable/similar characters in the argument, and returns a canonical form.A list of characters and their replacements can be found [[phab:source/Equivset/browse/master/data/equivset.in|on git]], e.g. <code>ccnorm( "Eeèéëēĕėęě3ƐƷ" ) === "EEEEEEEEEEEEE"</code>.<ref name="T27619">Be aware of [[phab:T27619]].You can use [[Special:AbuseFilter/tools]] to evaluate <code>ccnorm( "your string" )</code> to see which characters are transformed.</ref> The output of this function is always uppercase.
|-
| <code>ccnorm_contains_any</code> ||
|-
| <code>ccnorm_contains_all</code> ||
|-
| <code>specialratio</code> ||
|-
| <code>rmspecials</code> ||
|-
| <code>rmdoubles</code> ||
|-
| <code>rmwhitespace</code> ||
|-
| <code>count</code> ||
|-
| <code>rcount</code> ||
|-
| <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>
|