ralahari
Old Hand
Points: 301
More actions
October 15, 2023 at 10:19 pm
#4308685
How to replace all special characters in SQL input
System.Text.RegularExpressions.Regex.Replace(input, "\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
Phil Parkin
SSC Guru
Points: 247180
October 16, 2023 at 10:08 am
#4308975
What sort of input? A file?
October 16, 2023 at 3:29 pm
#4309111
Input is Varchar(max) String column in Table.
I Need to replace all Special character in the input column with "".
(input, "\{\*?\\[^{}]+}|[{}]|\\\n?[A-Za-z]+\n?(?:-?\d+)?[ ]?", "")
October 16, 2023 at 4:19 pm
#4309149
This function might help you: https://www.sqlservercentral.com/scripts/patexclude8k
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply