Skip to main content

1E 8.1 (on-premises)

REGEXPCAPTURE

Function

REGEXPCAPTURE

Action

Uses a regular expression to capture matching parts from a string.

Parameters

(string) Regular expression.

(string) Input string.

Return values

(string) Captured string.

Examples

// This example returns "something is better than nothing"
SELECT REGEXPCAPTURE("something (.*) nothing", "People say that something is better than nothing, but they're wrong!") AS Capture;
// This example returns rows from @commandLines, and pulls out the "parentProcessId" command-line argument
SELECT REGEXPCAPTURE("/parentProcessId .* ", CommandLine) AS ParentProcessIdArgument FROM @commandLines;

Notes