Search hit group
Syntax
$match.regexGroup()
$match.regexGroup($index)
Description
Returns the substrings of the search hits match
. These are selected by groups defined in the regex expression enclosed by ()
.
Parameter
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
match | Business object | The list of search hits from which only a substring should be selected. | yes | |
index | Number | Only groups with the index will be considered | no | 0 - returns the full text of the search hit |
Return value
Type: Set
A set of substrings of the search hits.
Examples
Without index
regex('ab+').regexSearch("XXXabbbYYYabb").regexGroup()
Output: ["abbb", "abb"]
Since no index was specified for the group, the search will be fully returned.
With index
regex('a(b+)').regexSearch("XXXabbbYYYabb").regexGroup(1)
Output: ["bbb", "bb"]
Only the substrings of group 1, i.e. (b+) are returned.