I'm sure this is a simple task, but I am a newbie & don't know how to accomplish this.
I have a form with an area for entering text. After saving the data entered from the text area I need to strip any carriage returns from the string, and have been doing so in the following manner:
And then I'm saving the string to a file. When the form is submitted from a Windows machine & there are carriage returns they are passed as DOS carriage returns. After replacing the \n with nothing there are still ^M characters in the file when viewed in vi. What regex is needed to get rid of the remaining characters?