title: Return only matched part of string
body: <p>I have string </p>
  
  <pre><code>var v = "09/30/2016 12:00am - 2:00am";
  </code></pre>
  
  <p>I need to get only date part of this string : <code>"09/30/2016"</code></p>
  
  <p>For it I have regex </p>
  
  <pre><code>var dateFormatRegex = /^(0[1-9]|1[012])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d\d$/ig;
  </code></pre>
  
  <p>But it only match string if there are only date string.</p>
  
  <p>What should I add to my regex to get <code>09/30/2016</code> from string <code>09/30/2016 12:00am - 2:00am</code>?</p>