SQL Flow Field Guide

REGEXP_MATCHES

Catalog support for SQL Server 2025 (17.x)

regex match rows

What changes

Input
string, pattern, flags
Output or change
rowset of matches and capture groups

Syntax at a glance

REGEXP_MATCHES ( string_expression, pattern_expression [ , flags ] )

Work example

Return captured regex groups as rows for a text parsing task.

Name the capture groups in the query contract and test values with missing or repeated groups.

Check your work No match returns no row, which differs from one row containing null.

Open Microsoft Learn for full syntax, permissions, and details for your version.