getGroupCount: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) No edit summary |
|||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=getGroupCount | |||
|description=Returns the number of capture groups for the match performed by [[strfind|strfind()]]. | |||
|usage= | |||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
[h: text = getGroupCount(id)] | [h: text = getGroupCount(id)] | ||
</source> | </source> | ||
id is the id returned by [[ | id is the id returned by [[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 14: | Line 14: | ||
</source> | </source> | ||
Returns 2. | Returns 2. | ||
}} | |||
[[Category:String Function]] |