$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] => index.html
[1] => a-34234234_b-3271_c-123_d-on_2013-08-12-10.csv
[2] => a-52342345_b-3271_c-123_d-on_2013-08-12-11.csv
[3] => a-8764453_b-3271_c-123_d-on_2013-08-12-12.csv
[4] => a-7654334_b-3271_c-1234_d-on_2013-08-12-4.csv
[5] => a-3435_b-3271_c-23re_d-on_2013-08-12-5.csv
[6] => a-909876_b-3271_c-wef2r2_d-on_2013-08-12-6.csv
[7] => a-345456_b-3271_c-23rwef_d-on_2013-08-12-7.csv
[8] => a-98765_b-3271_c-23ref_d-on_2013-08-12-8.csv
[9] => a-098765_b-3271_c-wef2r_d-on_2013-08-12-9.csv
)
$matchingFileNames = preg_grep ("/".$fileNameMatchRegex."/", $fileNames);
这在这里有效...我在 1-9 上得到了匹配:正则表达式测试器