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:

 

 

[label]

{object}.GetMaxCaptures

[GIVING {return}]

 

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:

  1. The ZERO flag is set to TRUE if the 'return' value is zero, otherwise the ZERO flag is set to FALSE.

  2. 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.

  3. The EOS flag is always cleared.

  4. The method is useful when designing patterns and replacement logic that depend on capture groups.

  5. Whole match is group 0; capture groups begin at 1.

  6. The {return} value is the maximum capture count.

 

Example 1:

 

      RegEx1.GetMaxCaptures Giving N

 

See Also: Method Syntax, REGEX, Regular Expression Support



PL/B Language Reference