<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_find_word%2Fdoc</id>
	<title>Template:Str find word/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://safernicotine.wiki/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Template%3AStr_find_word%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_find_word/doc&amp;action=history"/>
	<updated>2026-05-10T10:50:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_find_word/doc&amp;diff=40713&amp;oldid=prev</id>
		<title>imported&gt;DePiep: /* todo */</title>
		<link rel="alternate" type="text/html" href="https://safernicotine.wiki/mediawiki/index.php?title=Template:Str_find_word/doc&amp;diff=40713&amp;oldid=prev"/>
		<updated>2023-03-21T10:28:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;todo&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
{{Template rating|alpha}}&lt;br /&gt;
{{Lua|Module:Str find word}}&lt;br /&gt;
This template looks for a &amp;#039;&amp;#039;word&amp;#039;&amp;#039; in a comma-separated &amp;#039;&amp;#039;list of words&amp;#039;&amp;#039;. It returns a True (found) or False (not found) value.&lt;br /&gt;
&lt;br /&gt;
By default, the True-value returned is the found word itself; the False-value is a blank string.&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=foo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=foo}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=nov}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=nov}}&lt;br /&gt;
&lt;br /&gt;
No partial fit. Partial word matching do &amp;#039;&amp;#039;not&amp;#039;&amp;#039; count as a hit:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foobar, bar |word=foo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foobar, bar |word=foo}}&lt;br /&gt;
&lt;br /&gt;
Case-sensitive: By default, the comparison is case-sensitive ({{mono|1=Foo ≠ foo}}); all text is turned into lowercase. One can make the check case-sensitive by {{para|case|true}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, Foo, bar |word=foo |case=false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, Foo, bar |word=foo |case=false}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, Foo, bar |word=foo |case=true}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, Foo, bar |word=foo |case=true}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using this template, the editor does not have to apply patterns ({{!xt|1=&amp;#039;%f[^,][^,]+%f[,]&amp;#039;}}). No return value interpretation is required (like {{!xt|1=when 1 then do x}}), though is optionally possible. There is no inbetween-result: the logic says it is either T or F. The logic can not result in an error.&lt;br /&gt;
&lt;br /&gt;
===options===&lt;br /&gt;
The True and False return values can be set through {{para|yes|}}, {{para|no|}}:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=foo |yes=Yesss |no=Nooo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=foo |yes=Yesss |no=Nooo}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=nov |yes=Yesss |no=Nooo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=nov |yes=Yesss |no=Nooo}}&lt;br /&gt;
&lt;br /&gt;
==Specifics==&lt;br /&gt;
;Words: A &amp;#039;word&amp;#039; is the character string between commas. This can be all characters and inner spaces:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo bar sunday, bar |word=foo bar sunday}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo bar sunday, bar |word=foo bar sunday}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, bar(22) [take care]!, foo |word=bar(22) [take care]!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, bar(22) [take care]!, foo |word=bar(22) [take care]!}}&lt;br /&gt;
&lt;br /&gt;
;Return value: True- and False-value can be set through {{para|yes|}}, {{para|no|}}:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=foo |yes=Yesss |no=Nooo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=foo |yes=Yesss |no=Nooo}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, foo, bar |word=nov |yes=Yesss |no=Nooo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, foo, bar |word=nov |yes=Yesss |no=Nooo}}&lt;br /&gt;
&lt;br /&gt;
;Boolean value read: Setting {{para|booleans|true}} will read common &amp;#039;&amp;#039;bolean words&amp;#039;&amp;#039; as boolean (true, false). &lt;br /&gt;
:Boolean words for true: &amp;#039;True&amp;#039;, &amp;#039;T&amp;#039;, &amp;#039;Yes&amp;#039;, &amp;#039;1&amp;#039;. False: &amp;#039;False&amp;#039;, &amp;#039;F&amp;#039;, &amp;#039;No&amp;#039;, &amp;#039;0&amp;#039;. Boolean words are always case-insensistive (True=true).&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, yes, bar |word=true |booleans=true}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, yes, bar |word=true |booleans=true}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, false, bar |word=0 |booleans=true}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, false, bar |word=0 |booleans=true}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, false, bar |word=0 |booleans=false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;(default) &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, false, bar |word=0 |booleans=false}}&lt;br /&gt;
&lt;br /&gt;
===Word lists===&lt;br /&gt;
The word list {{para|source}} is comma-separated. Prefixed and suffixed spaces are discarded (trimmed).&lt;br /&gt;
:{{mono|1={{bg|orange|{{hair space}}}}{{bg|yellow|alpha}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|foo}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|bar}}}}{{bg|orange|{{hair space}}}}&lt;br /&gt;
:Inner spaces are kept, and are part of the &amp;#039;word&amp;#039;:&lt;br /&gt;
:{{mono|1={{bg|orange|{{hair space}}}}{{bg|yellow|alpha}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|foo}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|hello world}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|bar}}}}{{bg|orange|{{hair space}}}}&lt;br /&gt;
:Any character apart from {{Angle bracket|,}} comma can be part of the word:&lt;br /&gt;
:{{mono|1={{bg|orange|{{hair space}}}}{{bg|yellow|&amp;amp;alpha;(12) [mind the gap]!}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|foo}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|hello world}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|bar}}}}{{bg|orange|{{hair space}}}}&lt;br /&gt;
&lt;br /&gt;
:Multiple spaces (whitespace) inside a string is reduced to a single space:&lt;br /&gt;
:{{bg|orange|{{hair space}}}}{{bg|yellow|alpha}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;&amp;amp;nbsp;}}{{bg|yellow|foo &amp;amp;nbsp; &amp;amp;nbsp;bar}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|orange|{{hair space}}}}&lt;br /&gt;
&lt;br /&gt;
:equals {{bg|orange|{{hair space}}}}{{bg|yellow|alpha}}{{bg|orange|,}}{{bg|#e6e6e6|&amp;amp;nbsp;}}{{bg|yellow|foo bar}}{{bg|orange|,}}{{bg|orange|{{hair space}}}}&lt;br /&gt;
&lt;br /&gt;
;Spaces {{Angle bracket|&amp;amp;nbsp;}}, Comma {{Angle bracket|,}}, quote {{Angle bracket|&amp;quot;}}, pipe {{Angle bracket|{{!}}}}&lt;br /&gt;
&lt;br /&gt;
;Trimmed spaces: All words are trimmed before checking (leading and trailing whitespace is removed; repeated inner whitespaces are reduced to one space):&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha , hello &amp;amp;nbsp; world,  foo |word=hello world}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha , hello &amp;amp;nbsp; world,  foo|word=hello world}}&lt;br /&gt;
:::...but the remaining in-word space does matter:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, hello &amp;amp;nbsp; world, foo |word=helloworld}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, hello &amp;amp;nbsp; world, foo |word=helloworld}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
;Comma {{Angle bracket|,}}: When a comma {{Angle bracket|,}} is part of the word to check. Word strings that contain a comma can be made literal (escape the comma):&lt;br /&gt;
:{{nay}} {{red|TODO check this doc claim}} &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;}}&lt;br /&gt;
:??chk: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;|literals=false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;|literals=false}}&lt;br /&gt;
:??chk: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;|literals=true}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, &amp;quot;hello, world&amp;quot;, foo |word=&amp;quot;hello, world&amp;quot;|literals=true}}&lt;br /&gt;
&lt;br /&gt;
;Quote character {{Angle bracket|&amp;quot;}}: Conversely, quote characters {{Angle bracket|&amp;quot;}} that are part of the word are escaped by setting {{para|literals|false}}:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, she said  &amp;quot;hello world&amp;quot;, &amp;quot;foo&amp;quot; |word=she said &amp;quot;hello world&amp;quot; |literals=false}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, she said &amp;quot;hello world&amp;quot;, &amp;quot;foo&amp;quot; |word=she said &amp;quot;hello world&amp;quot; |literals=false}}&lt;br /&gt;
&lt;br /&gt;
;Pipe {{Angle bracket|{{!}}}}: The pipe character can be entered as &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, hello{{!}}world, foo |word=hello{{!}}world }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, hello{{!}}world, foo |word=hello{{!}}world }}&lt;br /&gt;
&lt;br /&gt;
===Checking multiple words===&lt;br /&gt;
It is possible to check &amp;#039;&amp;#039;multiple words&amp;#039;&amp;#039; against the source wordlist. &lt;br /&gt;
;AND-words to check&lt;br /&gt;
:{{para|andwords|}}: can have a &amp;#039;&amp;#039;wordlist&amp;#039;&amp;#039; (comma-separated as {{para|source|}} is). Each word will be checked against the source. When all and-words are found, the return value is True.&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, gamma, foo, bar |andwords=alpha, foo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, gamma, foo, bar |andwords=alpha, foo}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, gamma, foo, bar |andwords=bar, foo, beta, alpha}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, gamma, foo, bar |andwords=bar, foo, beta, alpha}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, gamma, foo, bar |andwords=alpha, nov}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, gamma, foo, bar |andwords=alpha, nov}}&lt;br /&gt;
&lt;br /&gt;
;OR-words to check&lt;br /&gt;
:{{para|orwords|}}: can have a &amp;#039;&amp;#039;wordlist&amp;#039;&amp;#039; (comma-separated as {{para|source|}} is). Each word will be checked against the source. When a single or-words is found, the return value is True. Default True return value is the list with all words found.&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, gamma, foo, bar |orwords=alpha, foo}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, gamma, foo, bar |orwords=alpha, nov}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, happy, gamma, nice, foo, bar |orwords=april, sad, happy, ugly, nice}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, happy, gamma, nice, foo, bar |orwords=april, sad, happy, ugly, nice}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, happy, gamma, nice, foo, bar |orwords=sad, ugly, november}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, happy, gamma, nice, foo, bar |orwords=sad, ugly, november}}&lt;br /&gt;
&lt;br /&gt;
;Both AND-words, OR-words to check&lt;br /&gt;
:{{para|andwords|}}, :{{para|orwords|}} can be used together. Each wordlist will get its own logical checks (AND-words must all be present; OR-words at least one)&lt;br /&gt;
:T: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, april, gamma, foo, happy |andwords=alpha, beta |orwords=april, november, sad, ugly}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=True}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, april, gamma, foo, happy |andwords=alpha, beta |orwords=april, november, sad, ugly}}&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Str find word |source=alpha, beta, april, gamma, foo, happy |andwords=alpha, november |orwords=april, november, sad, ugly}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;({{code|1=False}})&amp;lt;/small&amp;gt; &amp;amp;rarr; {{Str find word |source=alpha, beta, april, gamma, foo, happy |andwords=alpha, november |orwords=april, november, sad, ugly}}&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! {{para|1=source}}&lt;br /&gt;
! {{para|1=word}}&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | result&lt;br /&gt;
! note&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foo}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|nov}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=nov}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, uc-all}}&lt;br /&gt;
| {{para|word|uc-all}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, uc-all|word=uc-all}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, hello world_, bar}}&lt;br /&gt;
| {{para|word|hello world_}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, hello world_, bar|word=hello world_}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| The comma is the word-delimiter&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha,foo &amp;amp;nbsp;&amp;amp;nbsp;bar&amp;amp;nbsp;, lima}}&lt;br /&gt;
| {{para|word|&amp;amp;nbsp;&amp;amp;nbsp;foo &amp;amp;nbsp;&amp;amp;nbsp;bar}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha,foo &amp;amp;nbsp;&amp;amp;nbsp;bar&amp;amp;nbsp;, lima|word=&amp;amp;nbsp;&amp;amp;nbsp;foo &amp;amp;nbsp;&amp;amp;nbsp;bar}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| Spaces are trimmed, multi-space into one space&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo bar, lima}}&lt;br /&gt;
| {{para|word|foobar}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo bar, lima|word=foobar}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| An inner space is a character too&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, FOO, bAr, lima}}&lt;br /&gt;
| {{para|word|bar, foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, FOO, bAr, lima|word=bar, foo}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| Not case-sensistive by default&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, FOO, bAr, lima}}&lt;br /&gt;
| {{para|word|bar, foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, FOO, bAr, lima|word=bar, foo|case=true}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| {{para|case|true}}: case-sensistive&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==note==&lt;br /&gt;
:The editor does not have to apply Lua patterns like {{code|1=[%a%d]*}}&lt;br /&gt;
:The editor does not have to interpret the return value (as in: &amp;quot;when =&amp;#039;blue&amp;#039; then ...&amp;quot;). They can prescribe the value even (yes-value, no-value).&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
===Basic===&lt;br /&gt;
Core function:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Str find word&lt;br /&gt;
|source =&lt;br /&gt;
|word  =&lt;br /&gt;
|yes  =&lt;br /&gt;
|no   =&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:When the &amp;#039;&amp;#039;word&amp;#039;&amp;#039; is found in the &amp;#039;&amp;#039;source&amp;#039;&amp;#039; (True), the function returns the &amp;#039;&amp;#039;word&amp;#039;&amp;#039; itself (by default), or {{para|yes}} value (when entered non-empty).&lt;br /&gt;
:When not found (False), the function returns an empty string ({{code|&amp;#039;&amp;#039;}}), or the {{para|no}} value when entered.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! {{para|1=source}}&lt;br /&gt;
! {{para|1=word}}&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | result&lt;br /&gt;
! note&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foo}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, uc-all}}&lt;br /&gt;
| {{para|word|uc-all}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, uc-all|word=uc-all}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| &amp;quot;-&amp;quot; (hyphen) is part of the word&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, do_something, white}}&lt;br /&gt;
| {{para|word|do_something}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, do_something, white|word=do_something}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| &amp;quot;_&amp;quot; (underscore) is part of the word&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|november}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=november}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foobar, lima}}&lt;br /&gt;
| {{para|word|foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foobar, lima|word=foo}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| &amp;#039;foo&amp;#039; is not the complete word&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| no {{para|word}} entered&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foobar}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foo-bar|yes=Yes, hit|no=No, not found}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| full word &amp;#039;&amp;#039;foo-bar&amp;#039;&amp;#039; not in the source&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foobar}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo-bar, lima|word=foo|yes=Yes, hit|no=No, not found}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| word &amp;#039;&amp;#039;foo&amp;#039;&amp;#039; not in the source as full word&lt;br /&gt;
|- &amp;lt;!-- ===== ===== ===== ===== ===== ===== ===== --&amp;gt;&lt;br /&gt;
! colspan=&amp;quot;5&amp;quot; style=&amp;quot;padding-left:3em; text-align:left;&amp;quot; | {{code|1=...}} {{para|yes|Yes, hit}} {{para|no|Not found}}&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foo}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foo|yes=Yes, hit|no=No, not found}}&lt;br /&gt;
| {{aye}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=source|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|word|foobar}}&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foobar|yes=Yes, hit|no=No, not found}}&lt;br /&gt;
| {{nay}}&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===All parameters===&lt;br /&gt;
:All parameters, in three options&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Str find word&lt;br /&gt;
|string = &lt;br /&gt;
|word  =&lt;br /&gt;
|allwords =&lt;br /&gt;
|orwords = &lt;br /&gt;
|case=&lt;br /&gt;
|yes =&lt;br /&gt;
|no =&lt;br /&gt;
|explain =&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Str find word&lt;br /&gt;
|s  = &lt;br /&gt;
|w  =&lt;br /&gt;
|allw=&lt;br /&gt;
|orw =&lt;br /&gt;
|case=&lt;br /&gt;
|yes =&lt;br /&gt;
|no =&lt;br /&gt;
|explain =&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Str find word |s= |w= |allw= |orw= |case= |yes= |no= |explain=}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===More options===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! {{para|1=source}}&amp;lt;br/&amp;gt; {{para|1=s}} {{para|1=1}}&lt;br /&gt;
! {{para|1=word}}&amp;lt;br/&amp;gt;{{para|1=w}} {{para|1=2}}&lt;br /&gt;
! {{para|1=case}}&lt;br /&gt;
! colspan=&amp;quot;2&amp;quot; | result&lt;br /&gt;
! note&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=s|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|w|foo}}&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |s=alpha, foo, lima|w=foo|yes=yes|no=no}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=s|2=alpha, foo, lima}}&lt;br /&gt;
| {{para|w|foobar}}&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foo, lima|word=foobar|yes=yes|no=no}}&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=s|2=alpha, foobar, lima}}&lt;br /&gt;
| {{para|w|foo}}&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, foobar, lima|word=foo|yes=yes|no=no}}&lt;br /&gt;
| &amp;#039;foo&amp;#039; is not the complete word&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=s|2=alpha, FOO, lima}}&lt;br /&gt;
| {{para|w|foo}}&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, FOO, lima|word=foo|yes=yes|no=no|case=false}}&lt;br /&gt;
| {{para|case|false}}: a=A &amp;#039;&amp;#039;(default)&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
| {{para|1=s|2=alpha, FOO, lima}}&lt;br /&gt;
| {{para|w|foo}}&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| {{#invoke:Str find word|main |explain=true |source=alpha, FOO, lima|word=foo|yes=yes|no=no|case=true}}&lt;br /&gt;
| {{para|case|true}}: a=/=A&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===word list===&lt;br /&gt;
:Instead of a single word to check, a &amp;#039;&amp;#039;&amp;#039;list of target words&amp;#039;&amp;#039;&amp;#039; can be entered: {{para|word|alpha, foo, bingo}}. This {{para|word}}-list will be treated with &amp;#039;&amp;#039;AND&amp;#039;&amp;#039;-logic: each and all of the words &amp;#039;&amp;#039;must&amp;#039;&amp;#039; be present. See:&lt;br /&gt;
&lt;br /&gt;
===AND-, OR-wordlist checks===&lt;br /&gt;
:{{para|word}} as noted, can be a &amp;#039;&amp;#039;list of words&amp;#039;&amp;#039;. all will be checked with the &amp;#039;&amp;#039;AND&amp;#039;&amp;#039;-requirement (each word must be present).&lt;br /&gt;
:{{para|andwords}} accepts a &amp;#039;&amp;#039;list of words&amp;#039;&amp;#039; that all will be checked with the &amp;#039;&amp;#039;AND&amp;#039;&amp;#039;-requirement (each word must be present).&lt;br /&gt;
::When both {{para|word}}, {{para|andwords}} are present, they are combined into one single &amp;#039;&amp;#039;AND&amp;#039;&amp;#039;-wordlist.&lt;br /&gt;
:{{para|orwords}} accepts a &amp;#039;&amp;#039;list of words&amp;#039;&amp;#039; that all will be checked with the &amp;#039;&amp;#039;OR&amp;#039;&amp;#039;-requirement (at least one of the words must be present).&lt;br /&gt;
&lt;br /&gt;
==Errors and analysis==&lt;br /&gt;
* The logic itself does not produce errors. There is always a True of False result. &lt;br /&gt;
&lt;br /&gt;
* Pages with Unknown parameters are listed in {{clc|Category:Pages using str find word with unknown parameters}}.&lt;br /&gt;
&lt;br /&gt;
: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).&lt;br /&gt;
&lt;br /&gt;
* {{para|explain|true}}: when in {{button|Preview}}, display a report on input, output and the logical steps (debug).&lt;br /&gt;
* {{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).&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
{{String-handling templates |anlys/tech}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line --&amp;gt;&lt;br /&gt;
[[Category:String manipulation templates]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>imported&gt;DePiep</name></author>
	</entry>
</feed>