title: PHP preg_grep not working?
body: <pre><code>$fileNameMatchRegex = ^a-[0-9]*_b-[0-9]*_c-.*(_d-on)?_((19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01]))-[0-9]*\.csv$
  
  $fileNames = 
  
  Array  
  (
      [0] =&gt; index.html
      [1] =&gt; a-34234234_b-3271_c-123_d-on_2013-08-12-10.csv
      [2] =&gt; a-52342345_b-3271_c-123_d-on_2013-08-12-11.csv
      [3] =&gt; a-8764453_b-3271_c-123_d-on_2013-08-12-12.csv
      [4] =&gt; a-7654334_b-3271_c-1234_d-on_2013-08-12-4.csv
      [5] =&gt; a-3435_b-3271_c-23re_d-on_2013-08-12-5.csv
      [6] =&gt; a-909876_b-3271_c-wef2r2_d-on_2013-08-12-6.csv
      [7] =&gt; a-345456_b-3271_c-23rwef_d-on_2013-08-12-7.csv
      [8] =&gt; a-98765_b-3271_c-23ref_d-on_2013-08-12-8.csv
      [9] =&gt; a-098765_b-3271_c-wef2r_d-on_2013-08-12-9.csv
  )
  
  $matchingFileNames  = preg_grep ("/".$fileNameMatchRegex."/", $fileNames);
  </code></pre>
  
  <p>This works here...I get a match on 1-9: <a href="http://www.regular-expressions.info/javascriptexample.html" rel="nofollow">regex tester</a></p>