title: Why escaped dot Regex in Java doesn't match a entry string
body: <p>I'm trying to check if a string matches a regex of a double type value in Java.</p>
  
  <p>I want to understand why the following instruction prints "false".</p>
  
  <pre><code>System.out.println("1.".matches("1\\."));
  </code></pre>
  
  <p>And why this prints "false" </p>
  
  <pre><code>System.out.println("1.2".matches("[1-9][0-9]*(\\.[0-9]*)?"));
  </code></pre>
  
  <p>And why this prints "true"</p>
  
  <pre><code>System.out.println("1.2a".matches("-?\\d+(\\.\\d+)?"));
  </code></pre>