I am sure this has been asked before, but I cannot find it.
Basically, assuming you are parsing a text file of unknown origin and want to replace line breaks with some other delimiter, is this the best regex, or is there another?
(\r\n)|(\n)|(\r)
Fletcher - this did get asked once before.
Here you go: Regular Expression to match cross platform newline characters
The regex I use when I want to be precise is "\r\n?|\n".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With