title: How to validate HHMMSS in regex
body: <p>I tried like this it is not working, but not works for value 005959 format HHMMSS</p>
  
  <pre><code>if(Pattern.matches("^([0-23])([0-59])([0-59])$", value))
  {
      SimpleDateFormat dformat = new SimpleDateFormat("HHMMSS");
      dformat.setLenient(false);
      dformat.parse(value);
      return true;
  }
  </code></pre>