Examples/Parameter: includenotmatch (example 1)
Appearance
< Examples
Example
[edit source]This lists pages in the category Countries in North America, which contain (include) a call to the template "Country-Infobox" and uses the "capital" parameter of that template (using includematch) with an argument that contains "Ottawa" or "ottawa" as a text string. The include parameter also includes the page name by default in the output, and the "capital" parameter value. The table parameter is then used to format the results into a (simple) table.
Note that there is no pattern specified for the first element of the include statement. "OTTAWA" would not match; we could use the "i" modifier with the regexp to match without case sensitivity if desired.
- Code
{{#dpl:
|category = Countries in North America
|include = {Country-Infobox}:capital
|includenotmatch = /capital\s*=\s*[^¦]*[Oo]ttawa/s
|table = class="wikitable sortable",Country,Capital
}}
- Result
| Country | Capital |
|---|---|
| United States | Washington, D.C. |