Examples/Parameter: includematch (example 1)
Appearance
< Examples
Example
[edit source]This lists pages in the category Fruit examples, in the namespace Main, which contain (include) a call to the template Fruit-Infobox and with a grow parameter of that template (using includematch) to restrict results to those whose parameter value contains "Vines" or "vines" as a text string. The include parameter also includes the page name by default in the output, and the grows parameter value. The table parameter is then used to format the results into a (simple) table.
- There is no pattern specified for the first element of the
includestatement. "VINES" would not match; the "i" modifier could be used with the regexp to match without case sensitivity if desired.
- Code
{{#dpl:
|category = Fruit examples
|namespace = Main
|include = {Fruit-Infobox}:grows
|includematch = /grows\s*=\s*[^¦]*[Vv]ines/s
|table = class="wikitable", Page, Growth Area
}}
- Result
| Page | Growth Area |
|---|---|
| Grape | On vines |