GetMatch Method (REGEX)
The GetMatch method is used to return the last successful matched substring 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 Character String Variable that returns the last successful matched substring.
Flags Affected: EOS, OVER, ZERO
Notes:
The EOS flag is set if the returned data string is larger than the DIM variable used to receive the data.
The OVER and ZERO Condition Flags are always cleared.
This method returns the value of the most recent successful method:
|
Method |
Returns the |
|
last match. | |
|
first matched text. | |
|
returned match. | |
|
last match. | |
|
replaced substring. | |
|
last replaced substring. | |
|
replaced substring. | |
|
first match. | |
|
last separator match. | |
|
matched text. |
The GetMatch method returns the object's cached last match. A match can be empty (zero-length), so an empty GetMatch does not by itself mean there was no match.
The object's last-match cache is cleared on the Compile method, Reset method, any no-match result and any no-replacement result..
Example 1:
See Also: Method Syntax, REGEX, Regular Expression Support
![]() |