RegularExpressions in SQL Server
-
Hi, I need regular expressions in SQL Server for two things 1. Get the first 3 characters from a string, no matter alphabets or numerical values but not special characters, like for example if I have file name A00Temp then it should give me A00 and if the string is _A00Temp then still it should give me the A00 only but not _A0, if it has ABCTemp then it should give me ABC 2. the 2nd need is if I have a string with alphabets, numerical and special characters then it should give me only alphabets from that string for exmple if I have: Abc def 230 then I should get abcdef, if I the string is _abc$#def then I should get only abcdef. If I can do this using regular expressions, please help me, any type of help is very welcome, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
-
Hi, I need regular expressions in SQL Server for two things 1. Get the first 3 characters from a string, no matter alphabets or numerical values but not special characters, like for example if I have file name A00Temp then it should give me A00 and if the string is _A00Temp then still it should give me the A00 only but not _A0, if it has ABCTemp then it should give me ABC 2. the 2nd need is if I have a string with alphabets, numerical and special characters then it should give me only alphabets from that string for exmple if I have: Abc def 230 then I should get abcdef, if I the string is _abc$#def then I should get only abcdef. If I can do this using regular expressions, please help me, any type of help is very welcome, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
-
Hi, I need regular expressions in SQL Server for two things 1. Get the first 3 characters from a string, no matter alphabets or numerical values but not special characters, like for example if I have file name A00Temp then it should give me A00 and if the string is _A00Temp then still it should give me the A00 only but not _A0, if it has ABCTemp then it should give me ABC 2. the 2nd need is if I have a string with alphabets, numerical and special characters then it should give me only alphabets from that string for exmple if I have: Abc def 230 then I should get abcdef, if I the string is _abc$#def then I should get only abcdef. If I can do this using regular expressions, please help me, any type of help is very welcome, thanks in advance.
Thanks, Abdul Aleem "There is already enough hatred in the world lets spread love, compassion and affection."
SQL Server doesn't have built-in regular expression support, but you can add it with SQLCLR: GitHub - DevNambi/sql-server-regex: Run regular expressions in SQL Server[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer