Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:String2/doc
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== findpagetext === The findpagetext function returns the position of a piece of text in the wikitext source of a page. It takes up to four parameters: * First positional parameter 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 [[Extension:Scribunto/Lua reference manual #Patterns|Lua pattern]] search. * Optional parameter |nomatch is the value returned when no match is found; default is nothing. ; Examples : <code><nowiki>{{#invoke:String2 |findpagetext |text=Youghiogheny}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=Youghiogheny}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=Youghiogheny |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=Youghiogheny |nomatch=not found}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=Youghiogheny |title=Boston Bridge |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=Youghiogheny |title=Boston Bridge |nomatch=not found}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=river |title=Boston Bridge |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=river |title=Boston Bridge |nomatch=not found}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=[Rr]iver |title=Boston Bridge |plain=false |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=[Rr]iver |title=Boston Bridge |plain=false |nomatch=not found}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=%[%[ |title=Boston Bridge |plain=f |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=%[%[ |title=Boston Bridge |plain=f |nomatch=not found}} : <code><nowiki>{{#invoke:String2 |findpagetext |text=%{%{[Cc]oord |title=Boston Bridge |plain=f |nomatch=not found}}</nowiki></code> β {{#invoke:String2 |findpagetext |text=%{%{coord |title=Boston Bridge |plain=f |nomatch=not found}} The search is case-sensitive, so Lua pattern matching is needed to find <code>river</code> or <code>River</code>. The last example finds <code><nowiki>{{coord</nowiki></code> and <code><nowiki>{{Coord</nowiki></code>. The penultimate example finds a wiki-link. The [[Template:Findpagetext]] is a convenience wrapper for this function.
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)