Examples/Parameter: includematch (example 2): Difference between revisions

From DynamicPageList3 Manual
Content added Content deleted
imported>FrozenPlum
(Created page with "<noinclude>{{note|Please '''do not edit''' this page unless you're wanting to edit the manual itself, it is an example included in the manual.|error}}</noinclude><!-- This is the example preloaded for testing, press "Show Preview" to see the example working (at the bottom of the page). If you save this page, it saves as a new section at the bottom of your '''User:Username/Sandbox''' --> ==Example== This list articles in the Category:Countries in North America cate...")
 
imported>FrozenPlum
 
(2 intermediate revisions by 2 users not shown)
Line 6: Line 6:
==Example==
==Example==


This list articles in the [[:Category:Countries in North America]] category, which contain a call to the template "Country-Infobox" and use the "capital" parameter of that template with an arguement that contains "Ottawa" as a text string. It would stop pattern matching after the line containing <code>|capital=Ottowa</code>. This example is formatted as a (simple) table using the {{DPL|table}} parameter.
This list articles in the [[:Category:Countries in North America]] category, which contain a call to the template "Country-Infobox" and use the "capital" parameter of that template with an argument that contains "Ottawa" as a text string. It would stop pattern matching after the line containing <code>|capital=Ottawa</code>. This example is formatted as a (simple) table using the {{DPL|table}} parameter.


<pre>
<pre>
<dpl>
{{#dpl:
category=Countries in North America
|category=Countries in North America
include={Country-Infobox}:capital
|include={Country-Infobox}:capital
includematch=/capital\s*=\s*[^|]*Ottawa/s
|includematch=/capital\s*=\s*[^¦]*Ottawa/s
table=class="wikitable sortable",Page,Capital
|table=class="wikitable sortable",Page,Capital
}}
</dpl>
</pre>
</pre>


==Result==
==Result==


<dpl>
{{#dpl:
category=Countries in North America
|category=Countries in North America
include={Country-Infobox}:capital
|include={Country-Infobox}:capital
includematch=/capital\s*=\s*[^|]*Ottawa/s
|includematch=/capital\s*=\s*[^¦]*Ottawa/s
table=class="wikitable sortable",Page,Capital
|table=class="wikitable sortable",Page,Capital
}}
</dpl>


<noinclude>
<noinclude>

Latest revision as of 22:40, 31 March 2023

Please do not edit this page unless you're wanting to edit the manual itself, it is an example included in the manual.

Example

This list articles in the Category:Countries in North America category, which contain a call to the template "Country-Infobox" and use the "capital" parameter of that template with an argument that contains "Ottawa" as a text string. It would stop pattern matching after the line containing |capital=Ottawa. This example is formatted as a (simple) table using the table parameter.

{{#dpl:
|category=Countries in North America
|include={Country-Infobox}:capital
|includematch=/capital\s*=\s*[^¦]*Ottawa/s
|table=class="wikitable sortable",Page,Capital
}}

Result

{{#dpl: |category=Countries in North America |include={Country-Infobox}:capital |includematch=/capital\s*=\s*[^¦]*Ottawa/s |table=class="wikitable sortable",Page,Capital }}