<?php $re = "#href=[\"']?(\d{4}(?:[-_]\d{2})+)[\"']?#"; $str = "href=\"XXXX-XX-XX\"\n\nhref=\"2015-05-15\",\nhref=\"2015-05-15_03_21_32\"\nhref=\"2014-12-21\"";
Standard input is empty
Array ( [0] => Array ( [0] => href="2015-05-15" [1] => href="2015-05-15_03_21_32" [2] => href="2014-12-21" ) [1] => Array ( [0] => 2015-05-15 [1] => 2015-05-15_03_21_32 [2] => 2014-12-21 ) )