Skip to main content

group (Function)

Returns the subsequence captured by the given group during the regex match operation.

Syntax

<STRING> regex:group(<STRING> regex, <STRING> input.sequence, <INT> group.id)

Query Parameters

NameDescriptionDefault ValuePossible Data TypesOptionalDynamic
regexA regular expression. For example, \d\d(.*)gdn.STRINGNoYes
input.sequenceThe input sequence to be matched with the regular expression. For example, 21 products are produced by gdn.STRINGNoYes
group.idThe given group id of the regex expression. For example, 2.INTNoYes

Example 1

    regex:group('\d\d(.*)(gdn.*)(gdn.*)', '21 products are produced within 10 years by gdn currently by gdn employees', 3)

Function returns gdn employees, the subsequence captured by the groupID 3 according to the regex pattern, \d\d(.*)(gdn.*)(gdn.*).