SQL Server regular expressions

2020-02-01 19:35发布

问题:

Wondering if it is possible to incorporate regular expressions into a SQL statement on SQL Server? I'm only finding that Oracle supports Regular Expressions.

回答1:

No, not without extra help such as writing a CLR function or something similar. T-SQL doesn't have builtin support for regular expressions.



回答2:

SQL Server supports limited pattern matching in the PATINDEX and LIKE expressions.

There's no native regex support in SQL Server, but you can expose the functionality in SQL Server 2005+ via CLR.