getFindCount: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) No edit summary |
|||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=getFindCount | |||
|description=Returns the number of times that [[strfind| strfind()]] was able to match the input string. | |||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: count = getFindCount(id)] | [h: count = getFindCount(id)] | ||
Line 10: | Line 10: | ||
The id is the id value returned by [[Macros:Functions:strfind| strfind()]]. | The id is the id value returned by [[Macros:Functions:strfind| strfind()]]. | ||
|example= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: id = strfind("this is a test", "(\\S+)\\s+(\\S+)\\s*")] | [h: id = strfind("this is a test", "(\\S+)\\s+(\\S+)\\s*")] | ||
Line 16: | Line 16: | ||
</source> | </source> | ||
Returns 2. | Returns 2. | ||
}} | |||
[[Category:String Function]] |