Regular expressions functions (Transact-SQL)
Applies to:
Azure SQL Database
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. |