title: Extract date from a given string in R
body: <p>Here is a string that I have</p>
  
  <pre><code>"7MA_S_VE_MS_FB_MEASURE_P1_2013-08-21_17-42-19.BMP"
  </code></pre>
  
  <p>I am trying to extract dates this way: </p>
  
  <pre><code>library(stringr)
  as.Date(str_extract(test,"[0-9]{4}/[0-9]{2}/[0-9]{2}"),"%Y-%m-%d")
  </code></pre>
  
  <p>I am getting <strong>NA</strong> for this. </p>
  
  <p><strong>Desired output</strong> is </p>
  
  <pre><code>2013-08-21
  </code></pre>
  
  <p>Can someone point me in the right direction? </p>