I'm trying to scan a file that has the DOS ^M
as end-of-line using something like:
Scanner file = new Scanner(new File(saveToFilePath)).useDelimiter("(?=\^M)")
In other words, I want to read the text line by line but also keep the ^M
that marks the end of the line. This would be easy with \n
but I'm not good with regexes and the DOS end-of-line
is driving me crazy.