Template:Arraysearch

Approximate recreation of the $($#arraysearch:}} parser function. It takes the same parameters:


 * The search term can be a regular expression (note that it will be inserted in a regular expression itself, so do not wrap it in pattern delimiters, use ^/$, etc.)
 * The offset must not point to an empty element or be greater than the length of the array
 * This template does not return the index of the element, but a 1 if the search term was found and an empty string otherwise (given the fourth/fifth parameters are not defined)

See arraydefine for a recreation of the {#arraydefine:}} parser function.

Examples: