Module:Str find word/doc: Difference between revisions

Content deleted Content added
No edit summary
Line 11:
 
For example, in the string '{{mono|1=alpha, foobar}}' the word '{{mono|1=alpha}}' appears, but the word '{{mono|1=foo}}' does not: there only is the complete word '{{mono|1=foobar}}'. The module is aimed at template code usage. <small>(The editor does not have to apply Lua patterns like {{code|1=[%a%d]*}})</small>.
 
A '''word''' is defined to be only of these characters: alphanumerics ('{{mono|1=a-z A-Z 0-9}}'), hyphen ('{{mono|1=-}}') and underscore ('{{mono|1=_}}'){{nbsp|1}}{{aye|12px}}. All other characters are non-word characters, and so possible word-separators (like {{nowrap|1='{{mono|1=;,()&lt;space&gt;}}'}}{{nbsp}}{{nay|12px}}).
 
== Usage ==
:{{red|This documentation is not updated yet}}. May be wrong in situiations. Soo also the tempalte documentation at {{tl|Str find word}}
 
===Basic===
Core function:
Line 175 ⟶ 173:
| {{para|case|true}}: a=/=A
|}
 
===word list===
:Instead of a single word to check, a '''list of target words''' can be entered: {{para|word|alpha, foo, bingo}}. This {{para|word}}-list will be treated with ''AND''-logic: each and all of the words ''must'' be present. See:
:Wordlist examples: {{para|word|''(wordlist)''}}
::{{para|word|{{bg|yellow|alpha}}, {{bg|yellow|foo}}}}
::{{para|word|{{bg|yellow|alpha-beta}}; {{bg|yellow|_bar}};{{bg|yellow|all-up}}#{{bg|yellow|foo}}({{bg|yellow|27}}) {{bg|yellow|Oct}} {{bg|yellow| Nov}} [{{bg|yellow|Dec}}]}}
::When {{para|word}} contains a wordlist, all words must be present to return the Yes value (''AND''-logic).
 
===AND-, OR-wordlist checks===
Line 241 ⟶ 232:
|}
 
==errorsErrors and analysis==
* The logic itself does not propduce errors. There is always a T of F result.
* Pages with Unknown parameters are listed in {{clc|Category:Unknown parameters}} (todo)
 
* Pages with Unknown parameters are listed in {{clc|Category:UnknownPages using str find word with unknown parameters}} (todo).
 
:There are no logical errors foreseen: any flaw in the input will return a False result (for example, no input strings to check were entered).
 
* {{para|explain|true}}: when in {{button|Preview}}, display a report on input, output and the logical steps (debug).
* {{para|explain|testcases}}: When set in ns {{mono|1=Template}} or {{mono|1=User}} on subpage {{mono|1=/testcases}}, the Preview report is static (shown permanently).
 
<includeonly>{{Sandboxsandbox other||
* [[:CategotyCategory:String manipulation templatesmodules]]
<!-- Categories below this line; interwikis at Wikidata -->
* [[:Categoty:String manipulation templates]]
}}</includeonly>