模板:Find page text/doc
此页面是Template:Find page text的模板文档。 此页面可能包含了模板的使用说明、分类和其他内容。 |
此模板使用Lua语言: |
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.
本模板于2024年5月26日 (日) 01:38 (UTC)通过议案Special:Diff/82782106设立。
参数
编辑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.
示例
编辑{{Find page text |Youghiogheny}}
→ 954{{Find page text |text=Youghiogheny}}
→ 954{{Find page text |text=Youghiogheny|nomatch=0}}
→ 954{{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.
参见
编辑- {{if in page}}