title: Simple Regex to match leading zeroes
body: <p>Am I misinterpreting something regarding Java regexes?  Shouldn't the following match the leading zero:</p>
  
  <pre><code>public class Testit {
      public static void main(String[] args) {
          format("0115724848");
      }
  
  
      private static void format(String elementToFormat) {
          if (elementToFormat.matches("^0")) {
              System.out.println("leading zero:" + elementToFormat);
          } else {
              System.out.println("no leading zero:" + elementToFormat);
          }
      }
  }
  </code></pre>