title: Date parsing with regular expressions in JavaScript
body: <p>I'm using match() in JavaScript to parse a dates from an RSS feed, I just can't get my head around the correct regular expression to find the date format.</p>
  
  <p>Here's the date:</p>
  
  <pre><code>2009-05-11 16:59:20
  </code></pre>
  
  <p>And the regular expression so far:</p>
  
  <pre><code>if (dateToParse.match(/^\d\d\d\d-\d\d-\d\d/)) {
          dateTimeSeparator = " ";
          monthIndex = 0;
          dayIndex = 1;
          yearIndex = 2;
  }
  </code></pre>