title: Scanner which will recognize only CR LF
body: <p>I am reading a file using the scanner class.I want my EOL delimiter to be CR LF but there are some records in the file which have only LF hence my scanner is reading the LF and going to the next line. I want the scanner to go to the next line only when it encounters CR LF both.<br>
  Here is my snippet: (using double slashes in the regex also gives same result)  </p>
  
  <pre><code>java.util.Scanner sMain = new java.util.Scanner(inputStream,encoding)
                                .useDelimiter(Pattern.compile("[\r\n]"));
  while (sMain.hasNextLine()) {  
  // sysout line  
  }
  </code></pre>