Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


FunctionREGEXPCAPTURE
Action


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


Parameters

(string) Regular expression.

(string) Input string.

Return values

(string) Captured string.

Examples


Code Block
languageperl
// 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;


Code Block
languageperl
// This example returns rows from @commandLines, and pulls out the "parentProcessId" command-line argument
SELECT REGEXPCAPTURE("/parentProcessId .* ", CommandLine) AS ParentProcessIdArgument FROM @commandLines;


Notes

Multiexcerpt include
MultiExcerptNameECMA262
PageWithExcerptMethod Notes