title: time regex for 12hr am and pm
body: <p>I have made this regex</p>
  
  <pre><code> ^(00|0[0-9]|1[012]):[0-5][0-9]? ((a|p)m|(A|P)M)$
  </code></pre>
  
  <p>but the problem is it is accepting 
  00:00 am which i dont want to be like this
  how to ignore?
  I want time to be in this format
  12:12 am
  it should not be in this 
  00:21 am
  I am using this code for validation</p>
  
  <pre><code>        private bool valtime()
      {
          Regex regex = new Regex("^(00|0[0-9]|1[012]):[0-5][0-9]? ((a|p)m|(A|P)M)$");
          if (regex.IsMatch(textBox1.Text))
          {
              return false;
          }
          else
          {
              return true;
          }
      }
  </code></pre>