Anonymous user
Module:String/doc: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
→match: update examples
(Tfd tag) |
(→match: update examples) |
||
Line 126:
; nomatch
: If no match is found, output the "nomatch" value rather than an error.
; ignore_errors
: If no match is found and ignore_errors=true, output an empty string rather than an error.
If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found.
Line 145 ⟶ 147:
* <code><nowiki>{{#invoke:String|match|s= abc |pattern= %d }}</nowiki></code> → {{#invoke:String|match|s= abc |pattern= %d }}
* <code><nowiki>{{#invoke:String|match|s= abc |pattern= %d |nomatch= No numeric characters in string }}</nowiki></code> → {{#invoke:String|match|s= abc |pattern= %d |nomatch= No numeric characters in string }}
* <code><nowiki>{{#invoke:String|match|s= abc |pattern= %d |ignore_errors= true }}</nowiki></code> → {{#invoke:String|match|s= abc |pattern= %d |ignore_errors= true }}
* <code><nowiki>{{#invoke:String|match|s= 0000012345 |pattern= ^0*(%d*)$ }}</nowiki></code> → {{#invoke:String|match|s= 0000012345 |pattern= ^0*(%d*)$ }}
* <code><nowiki>{{#invoke:String|match|s= 12345 |pattern= ^0*(%d*)$ }}</nowiki></code> → {{#invoke:String|match|s= 12345 |pattern= ^0*(%d*)$ }}
== pos ==
|