title: Java Scanner.nextLine() consumes newline character
body: <p>I have a scanner set up that is working on an InputStream.</p>
  
  <p>I am using Scanner.nextLine() to advance to each line, then doing some regular expression work on each line.</p>
  
  <p>I have a regular expression that is basically like <code>[\w\p{Z}]+?[;\n\r]</code> to pick up anything to the end of that line, or just ONE thing, if they are semi-colon delimited. </p>
  
  <p>so if my InpustStream looks like</p>
  
  <pre><code>abcd;
  xyz
  </code></pre>
  
  <p>It will pick up abcd;, but not xyz.</p>
  
  <p>I think this is because scanner is consuming the newline character at the end of the line of text must be getting consumed somehow when the .nextLine() function is being called. Can anyone tell me how to fix this problem?</p>
  
  <p>As an additional point of info, for my regex, i am compiling the pattern with Pattern.DOTALL</p>
  
  <p>Thanks!</p>