Skip to main content
Scalar function
NULL value or pattern returns NULL. A NULL group index returns NULL with a constant pattern, but is not reliably propagated with a pattern column.

Syntax

Scalar

Arguments

Returns

  • Type: ARRAY<STRING>
  • Possible values: Matching capture text; an empty array when nothing is captured.
  • NULL behavior: NULL value or pattern returns NULL. A NULL group index returns NULL with a constant pattern, but is not reliably propagated with a pattern column.
  • Shape: One string for each participating selected capture.
  • Ordering: Match encounter order.

Properties

Examples

Typical behavior

NULL scalar group

Default capture group and full match

Limitations

  • Use a constant capture-group index. A group column is not evaluated independently for each row.
  • Invalid regular expressions raise an error.
  • Negative or out-of-range group indexes return an empty array.
  • A NULL group index is not reliably propagated when pattern is a column; use a non-NULL constant index.
Last modified on October 15, 2026