title: Checking if a string starts and ends with number characters using regex
body: <p>I'm trying:</p>
  <pre class="lang-java prettyprint-override"><code>String string = &quot;123456&quot;;    
  if(string.startsWith(&quot;[0-9]&quot;) &amp;&amp; string.endsWith(&quot;[0-9]&quot;)){
      //code
  }
  </code></pre>
  <p>And the <code>if</code> clause is never called.</p>