I want to match 13/12/2015 (day, month, year in separate) of:
ASTA n° 30 | 13/12/2015 ore 10.00 | Arte Moderna & Contemporanea
With this Regex (PHP - preg_match):
/(\d{1,2})\D{1,4}(\d{1,2})\D{1,4}(\d{4}|\d{2})/imu
I got:
30 | 13/12
But I need 13/12/2015. Seems like Regex is not greedy enough... I know that the match I got is possible with my Regex, but I want to prefer the \d{4} over \d{2} (in the last round bracket).
EDIT: I need the \d{2} and \D{1,4} parts to be more flexible (there are dates like 13.10.15 or 13th 12.2015, etc.). Is there a way to reverse processing order of regex engine (end-to-start)? So it will first match \d{4} and then \d{2} (month and day)?