My program can accept data that has newline characters of \n, \r\n or \r (eg Unix, PC or Mac styles)
What is the best way to construct a regular expression that will match whatever the encoding is?
Alternatively, I could use universal_newline support on input, but now I'm interested to see what the regex would be.
\r
is the old Mac style (and by "old" I mean "OS 9 and before"). Any Mac running OS X (a.k.a. made after 1999) is going to use\n
like any other Unix. – Marvelmarvella'$'
to match the end of the line ? – Triceratopssplitlines()
. – Meister