I was tasked with capturing the route date in an email, but the dates are in different formats, I think I need help to find out if there is a way to capture the following formats:
02 APR
APR 02
2 APR
APR 2
2nd APR
APR 2nd
2nd April
April 2nd
APR 12th
April 12th
12th April
April 13-16
13-16 April
APR 13-16
13-16 APR
April 13th-16th
13th-16th April
APR 13th-16th
13th-16th APR
I tried a lot of ways, but just couldn't understand or understand, since I'm new to regex.
The closest I could get is:
(\d*)-(\d*) APR|April \d*\d*
EDIT - it turned out that I missed a few more formats.
13th - 16th APR
April 13 ~ 16
13/16 APR
I tried using the following:
(Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\ *\d+(?:[nr]d|th|st)?(?: * \d+(?:[nr]d|th|st)?)?|\d+(?:[nr]d|th|st)?(?: . \d+(?:[nr]d|th|st)?)?\ *(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)
You can either fix dates with or without space. Is there a way to capture all formats and divide the dates into "-", "/", "~" and output / write to a single standardization format?
(Group 1 Date)-Month (Group 2 Date)-Month eg: 13-Apr 16-Apr
Rate your wishes and comments.