• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.215
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Find page text

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
File:Test Template Info-Icon - Version (2).svg Template documentation[view] [edit] [history] [purge]
File:Lua-Logo.svgThis template uses Lua:
  • Module:String2

Wrapper for findpagetext function in Module:String2.

Template:Find page text returns the position of a piece of text in the wikitext source of a page.

Parameters

The template takes up to four parameters:

  • |1= or |text= is the text to be searched for.
  • Optional parameter |title= is the page title, defaults to the current page.
  • Optional parameter |plain= is either true for a plain search (default), or false for a Lua pattern search.
  • Optional parameter |nomatch= is the value returned when no match is found; default is nothing.

Examples

  • {{Find page text|Youghiogheny}} →
  • {{Find page text|text=Youghiogheny}} →
  • {{Find page text|text=Youghiogheny|nomatch=0}} → 0
  • {{Find page text|text=Youghiogheny|title=Boston Bridge|nomatch=not found}} → not found
  • {{Find page text|text=river|title=Boston Bridge}} →
  • {{Find page text|text=river|title=Boston Bridge|nomatch=not found}} → not found
  • {{Find page text|text=[Rr]iver|title=Boston Bridge|plain=false|nomatch=not found}} → not found
  • {{Find page text|text=%[%[|title=Boston Bridge|plain=f}} →
  • {{Find page text|text=%{%{[Cc]oord|title=Boston Bridge|plain=f}} →

The search is case-sensitive, so Lua pattern matching is needed to find river or River. The last example finds {{coord or {{Coord. The penultimate example finds a wiki-link.

The above documentation is transcluded from Template:Find page text/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Find_page_text&oldid=16707"
Categories:
  • Pages with broken file links
  • Lua-based templates
  • String manipulation templates
Last edited on 7 November 2021, at 13:59

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 7 November 2021, at 13:59.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop