How can I replace all types of line breaks (CR, LF and CrLf) using Regex?
I´ve tried different combinations of "\n" and "\r" but none finds them all.
formatedString = System.Text.RegularExpressions.Regex.Replace(text, "\r\n", "[Exp 1]")
The following code does the job but it bugs me that I can´t seem to replace the Line Feed using Regexp.
formatedString = formatedString.Replace(Environment.NewLine, "[Environment.NewLine]") ' Equals CR
formatedString = formatedString.Replace(ControlChars.CrLf, "[ControlChars.CrLf]") ' CR and LF
formatedString = formatedString.Replace(ControlChars.Cr, "[ControlChars.Cr]") ' Carriage Return (CR)
formatedString = formatedString.Replace(ControlChars.Lf, "[ControlChars.Lf]") ' Line Feed (LF)
All advices are most welcome! :)