Hi guys, I have this function in VB that I used in Access to replace all non-alphanumeric characters, including spaces and anything in brackets.
Now, I moved to SQL server and I'm writing scripts to do same thing.
How can I use RegEx in TSQL?
Only thing I will do is that function.
Code:
Public Function charOnly3(inputString As String) As String
Dim RE As Object
Set RE = CreateObject("vbscript.regexp")
RE.Pattern = "\([^)]+\)|[^\w]|_"
RE.Global = True
charOnly3 = RE.Replace(inputString, "")
Set RE = Nothing
End Function
How can I use RegEx in TSQL?
Only thing I will do is that function.
Last edited: