User:松/Drafts/Extension:AbuseFilter/Rules format: Difference between revisions
Content added Content deleted
m (459 revisions imported: Per request at the community portal.) |
(Translation code removal) |
||
Line 1: | Line 1: | ||
<languages/> |
|||
<translate> |
|||
<!--T:1--> |
|||
The rules are formatted much as conditionals in a C/Java/Perl-like language. |
The rules are formatted much as conditionals in a C/Java/Perl-like language. |
||
== Strings == |
== Strings == |
||
⚫ | |||
<!--T:3--> |
|||
⚫ | |||
<translate> |
|||
<!--T:4--> |
|||
⚫ | |||
⚫ | |||
<!--T:5--> |
|||
⚫ | |||
</translate> |
|||
; <translate><!--T:6--> Examples</translate>: |
|||
⚫ | |||
; Examples: |
|||
<syntaxhighlight lang="perl"> |
<syntaxhighlight lang="perl"> |
||
" |
" This is a string" |
||
' |
' This is also a string' |
||
' |
' This string shouldn\'t fail' |
||
" |
" This string\nHas a linebreak" |
||
1234 |
1234 |
||
1.234 |
1.234 |
||
Line 27: | Line 22: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
⚫ | |||
<translate> |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
<!--T:12--> |
|||
⚫ | |||
<translate> |
|||
<!--T:13--> |
|||
⚫ | |||
<translate> |
|||
<!--T:14--> |
|||
⚫ | |||
</translate> |
|||
<syntaxhighlight lang="c"> |
<syntaxhighlight lang="c"> |
||
Line 49: | Line 40: | ||
</syntaxhighlight> |
</syntaxhighlight> |
||
<translate> |
|||
==Arrays== |
==Arrays== |
||
</translate> |
|||
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-arrays.t --> |
<!--Note: these examples are also used in https://phabricator.wikimedia.org/diffusion/EABF/browse/master/tests/parserTests/mwexamples-arrays.t --> |
||
<translate> |
|||
⚫ | |||
<!--T:16--> |
|||
⚫ | |||
{{Caution|1=<translate><!--T:460--> Expressions like <tvar|1><code>page_namespace in [14, 15]</code></> may not work as expected.</translate> <translate><!--T:440--> This one will evaluate to <tvar|1><samp>true</samp></> also if <tvar|2><code>page_namespace</code></> is <tvar|3><samp>1</samp></>, <tvar|4><samp>4</samp></>, or <tvar|5><samp>5</samp></>.</translate> <translate><!--T:441--> For more information and possible workarounds, please see <tvar|1>[[:phab:T181024|T181024]]</>.</translate>}} |
{{Caution|1=<translate><!--T:460--> Expressions like <tvar|1><code>page_namespace in [14, 15]</code></> may not work as expected.</translate> <translate><!--T:440--> This one will evaluate to <tvar|1><samp>true</samp></> also if <tvar|2><code>page_namespace</code></> is <tvar|3><samp>1</samp></>, <tvar|4><samp>4</samp></>, or <tvar|5><samp>5</samp></>.</translate> <translate><!--T:441--> For more information and possible workarounds, please see <tvar|1>[[:phab:T181024|T181024]]</>.</translate>}} |