Operator Type:
Operator Scope of Action:
Operator Purpose:
Operator First Added:
Operator Last Altered:
Property [other Property type actions]
Query [operators of similar scope]
Data manipulation [other Data manipulation operators]
9.6.0
As at baseline
Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses
%matches
The expression %matches represents a list that contains all available back-references to regular expression matches. This is equivalent to the list of back reference values [$0;$1;$2….$N]
, where N is the count of available regular expression matches.
If $MyString is "I do not like green eggs and ham.", then for this code:
if($MyString.contains("like (((green) (eggs)) and ham)")){
$MyList = %matches;
};
$MyList now holds 5 back-references:
- $0:
like green eggs and ham
- $1
green eggs and ham
- $2
green eggs
- $3
green
- $4
eggs
Query back-references are discussed in fuller detail here.