I need help with this regular expression check. I'm new to regular expressions so please bail me out. Here's what I'm trying to do:
I'm trying to check if this date ranges both have months in their declaration e.g. Feb 10 - Feb 12
is correct while Feb 10 - 12
should fail. Also, some date instances may not have spaces between either the month and the day or the -
and the month or date. Here's my code.
preg_match("/([A-Za-z]{3}\ *?\d{1,2}).*?\g{1}/", "Feb10 -feb 13")
but it keeps failing.