title: javascript - regular expression to validate date in mm/dd/yyyy format
body: <p>I'm not good at regular expression. I got code to validate dd/mm/yyyy format which also validates leap year, I tried to modify to get it work for mm/dd/yyyy, but they all failed.</p>
  
  <p>Can some one change it to validate mm/dd/yyyy format?</p>
  
  <p>Regular Expression: </p>
  
  <blockquote>
    <p>^(((0[1-9]|[12]\d|3[01])/(0[13578]|1[02])/((19|[2-9]\d)\d{2}))|((0[1-9]|[12]\d|30)/(0[13456789]|1[012])/((19|[2-9]\d)\d{2}))|((0[1-9]|1\d|2[0-8])/02/((19|[2-9]\d)\d{2}))|(29/02/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$</p>
  </blockquote>
  
  <p><strong>Answer</strong>
  Hi All, thanks for the help from all of you, finally parsing again the regular expression, i got my answer to validate mm/dd/yyyy format</p>
  
  <p>Regular Expression: </p>
  
  <blockquote>
    <p>/^(((0[13578]|1[02])/(0[1-9]|[12]\d|3[01])/((19|[2-9]\d)\d{2}))|((0[13456789]|1[012])/(0[1-9]|[12]\d|30)/((19|[2-9]\d)\d{2}))|(02/(0[1-9]|1\d|2[0-8])/((19|[2-9]\d)\d{2}))|(02/29/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$/g</p>
  </blockquote>