title: What is best ways to validate string date to be valid date according to format?
body: <p>Started working with WEB UI recently. And encountered a problem of date string 
  parsing/validation. "dd-mm-yyyy" 
  Some approaches I found are:</p>
  
  <ol>
  <li><p>Matching - not complete validation, not flexible.</p>
  
  <p><code>(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])</code></p></li>
  <li><p>There was a post where guy suggest to preinitialize Set with possible date string - fast, valid, but also not flexible and memory consuming</p></li>
  </ol>
  
  <p>Is there something easier, maybe available in public libs ?</p>
  
  <p><em>Please don't suggest SimpleDateFormat</em> :)</p>
  
  <p><strong>UPDATE</strong>
  for java 8 correct answer 
  is <a href="https://stackoverflow.com/a/43076001/1479668">https://stackoverflow.com/a/43076001/1479668</a></p>