MatchAll Method (REGEX)
The MatchAll method is used to obtain all matching substrings using the stored regular expression 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 all matches joined into a single string.
text
Required. A Character String Variable or literal that specifies the text to examine.
delim
Optional. A Character String Variable or literal that specifies the delimiter character.
options
Optional. A decimal number or Numeric Variable that has a bit mask value described below.
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.
The {text} parameter contains the character string to be searched.
The search pattern used is the currently compiled pattern.
The {delim} character defaults to "|"
The {return} value is all matches joined into a single string with the {delim} character between matches.
A zero-length match counts as a match.
If no matches are found the GetMatch method will return an empty string.
If a match is found the GetMatch method will return the last match found.
The {options} bit mask values found in plbmeth.inc are defined as follows:
|
Equate |
Value |
Description |
|
$REGEX_OPT_NOCASE |
1 |
Case-insensitive (ASCII A-Z only) |
|
$REGEX_OPT_MULTILINE |
8 |
^ and $ also match at line breaks |
|
$REGEX_OPT_DOTALL |
16 |
. also matches CR and LF |
|
$REGEX_OPT_NOTEMPTY |
32 |
Reject empty (zero-length) matches |
The {options} given to Compile method also apply.
Example 1:
See Also: Method Syntax, REGEX, Regular Expression Support
![]() |