I am looking for a way to remove ‘stray’ carriage returns occurring at the beginning or end of a file. ie:
\r\n <-- remove this guy
some stuff to say \r\n
some more stuff to say \r\n
\r\n <-- remove this guy
How would you match \r\n followed by ‘nothing’ or preceded by ‘nothing’?
Try this regular expression: