Edit

Share via


Regular expressions functions (Transact-SQL) preview

Applies to: SQL Server 2025 (17.x) Preview Azure SQL Database Azure SQL Managed Instance SQL database in Microsoft Fabric

Note

As a preview feature, the technology presented in this article is subject to Supplemental Terms of Use for Microsoft Azure Previews.

Use the functions described in this article to match complex patterns and manipulate data in SQL Server with regular expressions.

Function Description
REGEXP_LIKE Returns a Boolean value that indicates whether the text input matches the regex pattern.
REGEXP_REPLACE Returns a modified source string replaced by a replacement string, where occurrence of the regex pattern found.
REGEXP_SUBSTR Extracts parts of a string based on a regular expression pattern.

Returns Nth occurrence of a substring that matches the regex pattern.
REGEXP_INSTR Returns the starting or ending position of the matched substring, depending on the option supplied.
REGEXP_COUNT Returns a count of the number of times that regex pattern occurs in a string.
REGEXP_MATCHES Returns a table of captured substring(s) that match a regular expression pattern to a string. If no match is found, the function returns no row.
REGEXP_SPLIT_TO_TABLE Returns a table of strings split, delimited by the regex pattern. If there's no match to the pattern, the function returns the string.

Regular expressions preview