title: Regex for 12hr and 24hr time format
body: <p>I am using two regex for validating time in 12hr and 24hr format,but in some cases it is not working.Am i doing something wrong in these regex?It is not working</p>
  
  <p>For validating 12 hr format like 10:00 AM/12:00 PM i have used regex </p>
  
  <pre><code>^(([0]?[0-9]|1[0-2]):[0-5][0-9][ ][aApP][mM])|((1[3-9]|2[0-3]):[0-5][0-9])$
  </code></pre>
  
  <p>For validating 24 hr format like 23:00/12:00 i have used regex </p>
  
  <pre><code>^(([0]?[0-9]|1[0-2]):[0-5][0-9])|((1[3-9]|2[0-3]):[0-5][0-9])$
  </code></pre>