I am trying to clear some data using exe helper (C #).
I repeat each line and I want to remove invalid characters from the beginning and end of the line, that is, remove dollar characters from $$$helloworld$$$ .
This works fine using this regex: \W
However, strings containing an invalid character in the middle should be left alone, i.e. hello$$$$world great, and my regex should not match this particular line.
So, in essence, I'm trying to figure out the syntax to match invalid characters at the beginning and end of a line, but leave the lines that contain invalid characters in their body.
Thank you for your help!
Chris source share