docsFunctionsStringZregexCapture

ZregexCapture

Returns the capture group at the given index from the first match of the pattern. Index 0 is the whole match, 1 and above are capture groups. Returns an empty string when the pattern does not match.

Syntax

ZregexCapture{text;pattern;index}

Arguments

NameTypeRequiredDefault
textstringYes-
patternstringYes-
indexnumberYes-

Example

ZregexCapture{warned by <@123> : spamming;warned by <@(\d+)> : (.+);1}