Method RegEx():getGroupCount() Foundation
Gets the number of capture groups in a match result.
:getGroupCount( <aMatch> ) --> nCount
The number of capture groups.
Helper class method that counts the number of capture groups in a match result array. The count excludes the full match (group 0).
Get group count
oRegEx := RegEx():create("(\d{4})-(\d{2})-(\d{2})")
aMatch := oRegEx:match("2023-12-25")
oRegEx:destroy()
? RegEx():getGroupCount(aMatch) // 3
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.