RPTools

Personal tools
From MapToolDoc
(Redirected from Macros:Functions:getGroupCount)

getGroupCount

getGroupCount() Function

Introduced in version 1.3b48

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

Usage

  1. [h: text = getGroupCount(id)]

id is the id returned by strfind()

Example

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

Returns 2.