title: How to check if a string contains a date?
body: <p>I'm trying to iterate on a <code>DataSet</code>, this contain a results of query such as <code>SELECT * FROM tb 1</code>, now the first three field contains a date, the format saved in the database table is this:</p>
  
  <pre><code>yyyy-MM-dd HH:mm:ss
  </code></pre>
  
  <p>but the code return this:</p>
  
  <pre><code>yyyy/MM/dd HH:mm:ss
  </code></pre>
  
  <p>in particular this:</p>
  
  <pre><code>For z = 1 To ds.Tables(0).Columns.Count - 1
  
      Console.WriteLine(ds.Tables(0).Rows(x)(z).ToString())
  
  Next
  </code></pre>
  
  <p>So I need to recognize if the current string have this format: <code>yyyy/MM/dd HH:mm:ss</code> and parse it into: <code>yyyy-MM-dd HH:mm:ss</code> I tough to a <code>regex</code> pattern for recognize it, but I'm not an expert of regex. Anyway, if there is another solution I'll glad to see. Note that only the first three value and the last one of the table is date, the other values aren't date but contain integer or other string value.</p>