My goal is to detect the exact kind of newline a string object is using.
If you open a file, you can make it use universal newline support internally, with 'U' or 'rU'. However suppose you need to work on string objects that are not files. re would do but it sounds like an overkill.
Is it possible to determine the kind of newline of a string object?
Out of the many kinds of representations of EOL, I'm interested in three: "\n" you usually use, "\r\n" for Windows/DOS/CP/M/OS/2 and "\r" for legacy Macs < 10.