Group count: Difference between revisions
Jump to navigation
Jump to search
imported>Bale Created page with '{{ #vardefine:name|group_count}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function_category=String Handling Routines| function1={{Function| name={{#va…' |
imported>Bale mNo edit summary |
||
Line 5: | Line 5: | ||
FunctionPage| | FunctionPage| | ||
name={{#var:name}}| | name={{#var:name}}| | ||
function1={{Function| | function1={{Function| | ||
Line 22: | Line 21: | ||
see_also={{SeeAlso|group}}| | see_also={{SeeAlso|group}}| | ||
}} | }} | ||
[[Category:String Handling Routines]] |
Revision as of 05:14, 22 May 2010
needs(code_samples);
Function Syntax
int group_count(matcher pattern )
- pattern is the matcher to search
Returns the number of capturing groups in the pattern. Group zero denotes the entire pattern by convention, but it is not included in this count. Any non-negative integer smaller than or equal to the value returned by this function is guaranteed to be a valid group() parameter for this matcher.