I have what I’m guessing is a fairly basic regular expression problem:
// Example strings
$string = "test test 24/11/2009";
$string = "test test 21-11-09";
$string = "test testtest 24.11.2009test";
$delim = "(\.|-|/)";
// dd/mm/yyyy
preg_match("#[^0-9](\d{1,2})$delim(\d{1,2})$delim(20\d{2})[^0-9]#i", $string, $result);
// dd/mm/yy
preg_match("#[^0-9](\d{1,2})$delim(\d{1,2})$delim(\d{2})[^0-9]#i", $string, $result);
Now I want to match the delimiters without them showing up in the $result array.
Delimiter is one in “.”, “-“, “/”: and they are not included in $result because they aren’t in “()”