GetMaxCaptures Method (REGEX)
The GetMaxCaptures method is used to get the maximum capture count supported by the regular-expression engine in the associated PL/B REGEX object. This method uses the following format:
|
|
|
|
Where:
label
Optional. A Program Execution Label.
object
Required. A REGEX object previously declared.
return
Optional. A Numeric Variable that returns the maximum capture count.
Flags Affected: EOS, OVER, ZERO
Notes:
The ZERO flag is set to TRUE if the 'return' value is zero, otherwise the ZERO flag is set to FALSE.
The OVER flag is set TRUE if the 'return' variable is too small and cannot contain the 'return' value without being truncated. Otherwise, the OVER flag is set to FALSE.
The EOS flag is always cleared.
The method is useful when designing patterns and replacement logic that depend on capture groups.
Whole match is group 0; capture groups begin at 1.
The {return} value is the maximum capture count.
Example 1:
See Also: Method Syntax, REGEX, Regular Expression Support
![]() |