Template:NumberNabber: Difference between revisions

From IdleOn MMO Wiki
imported>Kiokurashi
No edit summary
imported>Kiokurashi
No edit summary
Line 1: Line 1:
<includeonly><!-- ## Find position of Search string (Default: File:Pagename)
<includeonly><!-- ## Find position of Search string (Default: Pagename)
-->{{#vardefine:pos|{{#pos:{{{1|}}}|{{{2}}}}}}}<!--
-->{{#vardefine:pos|{{#pos:{{{1|}}}|{{{2}}}}}}}<!--
-->{{#vardefine:pos|{{#ifexpr: {{#var:pos}} > 15|{{#expr:{{#var:pos}}-15}}|0}}}}<!--
## Create substring for Regex:
## Create substring for Regex:
-->{{#vardefine:string|{{#sub:{{{1|}}}|{{#var:pos}}|20}}}}<!--
-->{{#vardefine:string|{{#sub:{{{1|}}}|{{#ifexpr: {{#var:pos}} > 10| {{#expr:{{#var:pos}}-10}}|0}}|{{#var:pos}}}}}}<!--
## Regex for returning "first" number found.
## Regex for returning "first" number found.
-->{{#rmatch:{{#var:string}}|([0-9]*)|$1|Not Found}}</includeonly>
-->{{#rmatch:{{#var:string}}|([0-9]*)|$1|Not Found}}</includeonly>

Revision as of 18:54, 2 July 2021