I'm new to Regex expressions and wondering if its even possible to get one to do what i want. Say i have a string: '2332433Reason:this was not approved' And assume there are hundreds of rows and maybe only half of them actually have the Reason: part in it. I'm hoping to use replace in the Regex to turn the column into just 'Reason: this was not approved'
Something similar to this:
RTRIM(LTRIM(SUBSTRING(Reason_Change_Content, CHARINDEX('Reason:', Reason_Change_Content), LEN(Reason_Change_Content))))
If this is possible can someone tell me how to write the regular expression and replacement text?
Thanks
Solved! Go to Solution.
Never mind, i just realized there was a typo causing it. For anyone else that might be looking for a similar answer... seems you can do something as easy as this:
Regular expression: Reason:(.*)
Replacement Text: $1
For anyone else looking for Regex help, I find this website to be awesome!
:-) another great one is http://regex101.com
Like the site recommended by @Treyson - both allow you to practice and get outcomes in real-time - with explanations etc.