Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server regular expressions

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.

like image 295
deDogs Avatar asked Mar 06 '11 18:03

deDogs


2 Answers

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.

like image 133
OMG Ponies Avatar answered Oct 13 '22 21:10

OMG Ponies


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

like image 37
squillman Avatar answered Oct 13 '22 21:10

squillman