regexp->groupCount

Returns capture group count.

Target member

Signature

1regexp->groupCount()

Returns capture group count.

regexp->groupCount is called with member syntax on a receiver value. regexp->groupCount uses the regular-expression surface for pattern matching. Keep patterns small, name the intent in nearby code, and test captures separately from replacement strings.

Examples

Basic call

1regexp('([a-z]+)([0-9]+)')->groupCount
The example shows the normal call shape. Adapt variable names, validation, and surrounding error handling to the context.