RegEx in TSQL

mardi 28 avril 2015

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.

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

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.
RegEx in TSQL

0 commentaires:

Enregistrer un commentaire

Labels