groups()

Returns items that match a given group of regular expressions in a string to an array.

Syntax

groups(STR_EXPR, REGEX_PATTERN)
Required Parameters
STR_EXPR
Source string expression to be extracted
REGEX_PATTERN
Regular expression with grouping

Usage

json "{}"
| eval array=groups("Mar 29 2004 09:54:39", "(.*?) (.*?) (.*?) ")
  => [Mar, 29, 2004]