Module:Str find word/doc

Implements Str find word.

This module looks for a full word in a comma-separated list of words. It then returns a True or False value. By default, the True-value returned is the found word itself; the False-value is a blank string.


 * The search can be extended to check for multiple words being present.

For example, in the string 'alpha, foobar' the word 'alpha' appears, but the word 'foo' does not: there only is the complete word 'foobar'. The module is aimed at template code usage. (The editor does not have to apply Lua patterns like [%a%d]*).

Usage

 * . See template Str find word.

Basic
Core function:


 * When the word is found in the source (True), the function returns the word itself (by default), or yes value (when entered non-empty).
 * When not found (False), the function returns a empty string (''), or the no value when entered.

All parameters

 * All parameters, in three options

AND-, OR-wordlist checks

 * word as noted, can be a list of words. all will be checked with the AND-requirement (each word must be present).
 * andwords accepts a list of words that all will be checked with the AND-requirement (each word must be present).
 * When both word, andwords are present, they are combined into one single AND-wordlist.
 * orwords accepts a list of words that all will be checked with the OR-requirement (at least one of the words must be present).

issues and ideas

 * keep the order, Foo, bar -> foo(1), bar(2)
 * eg table col userinput options, then cols in that order?

Errors and analysis

 * The logic itself does not produce errors. There is always a True of False result.


 * Pages with Unknown parameters are listed in.


 * 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).


 * true: when in, display a report on input, output and the logical steps (debug).
 * testcases: When set in ns Template or User on subpage /testcases, the Preview report is static (shown permanently).