getGroupCount: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function getGroupCount== {{ProposedChange}} Returns the number of capture groups for the match performed by strfind(). ===Usage=== <source lang="mtmacro" l...)
 
Line 1: Line 1:
==Function getGroupCount==
==Function getGroupCount==
{{ProposedChange}}


Returns the number of capture groups for the match performed by [[Macros:Functions:strfind|strfind()]].
Returns the number of capture groups for the match performed by [[Macros:Functions:strfind|strfind()]].

Revision as of 14:59, 6 December 2008

Function getGroupCount

Returns the number of capture groups for the match performed by strfind().

Usage

[h: text = getGroupCount(id)]

id is the id returned by strfind()

Examples

[h: id = strfind("this is a test", "(\\S+)\\s(\\S+)\\s*")]
[r: getGroupCount(id)]

Returns 2.