REGEX_GROUP_MATCH
The REGEX_GROUP_MATCH function is used to match a regular expression pattern against a string content and retrieve a specific declared group.
Usable: Value Fields, Context Filter
Syntax: { REGEX_GROUP_MATCH((PARAM_1 PARAM_2 PARAM_3)) }
Parameter | Type | Examples | Description |
---|---|---|---|
PARAM_1 | JSONPath value |
| The JSONPath expression representing the value that should be matched against the regular expression pattern. |
PARAM_2 | String |
| The regular expression pattern to match against the value in PARAM_1 |
PARAM_3 | String |
| The matching group that should be used |
Value Field Example
Get the value of the second group match
{ REGEX_GROUP_MATCH(($.value '^([^\s]*)' '2')) }
If $.value
contains 'the name (7) (test)'
the result will be test
.
Context Filter Example
To filter results where the “id” equals the custom field value of the issue at the first quotes:
{ REGEX_GROUP_MATCH(($.issue.fields.customfield_X '\((\S*)\)' '1')) }
If the $.issue.fields.customfield__X
field contains 'the name (7) (test)'
the expression will resolve to:
$.result[?(@.id=='7')]