What would be the proper format for the following regular expression in SQL Server?
select top 100 *
from posts
where tags like '(c++)|(performance)'
SQL Server does not support formal regex, so you will have to use LIKE here:
SELECT TOP 100 *
FROM posts
WHERE tags LIKE '%c++%' OR tags LIKE '%performance%';
Note: If the tags column really stores one tag per record, then just use equality checks:
SELECT TOP 100 *
FROM posts
WHERE tags IN ('%c++', 'performance');
LIKE operator is enhanced and does have some very basic regex capability, and there is a PATINDEX function with some regex support. If you show your actual data, maybe the above query can be improved upon.