title: Difference between '\Z' and '\z' in java.util.regex.Pattern
body: <p>What is the difference between the JDK6 <code>java.util.regex.Pattern</code>'s "Boundary matchers" '\z' and '\Z'?</p>
  
  <p>Background: I was trying to read a UTF-8 encoded file's contents into a <code>String</code>. Came across <a href="https://stackoverflow.com/a/3403112/438758">this solution</a>. I discovered that <code>java.util.scanner.useDelimeter</code> uses a <code>java.util.regex.Pattern</code>. The previously mentione solution proposes '\Z'.</p>