Unfortunately, support for regular expressions in mssql is terrible, the closest like operator, which skips regular expression functionality by a mile. You will need to take a look at breaking up the regular expression into several similar statements and probably do some dirty string manipulations to mimic what you are trying to achieve.
For example, if we could replicate [[: blank:]] on [] (read [Space Tab]), we canβt apply zero or more, so instead we need to deduce them from the expression, but this will match βASDβ , so we need to check for the presence of ASD in the unchanged string.
I think the following will replace your regex, but it was quickly assembled, so check it carefully.
replace(replace(somefield,' ',''),' ','') in ('ASD','|ASD','|ASD|','ASD|') and somefield like '%ASD%'
Again, in my substitution statements, one space with another tab.
Robb
source share