This is regarding the the process capturing the instances of multiple time formats from the string into list/array.
For example strInput = “Today’s meeting can be from 07:00 AM - 02:00 PM or 6am-2pm or 6am-11AM”
Then capture 3 instances of times into a string array\list variable.
List of the strings formats of time range to check are:
07:00 AM - 02:00 PM
07:00 am - 02:00 pm
07:00 AM to 02:00 PM
07:00 am to 02:00 pm
8:00 am to 3:00 pm
8:00 AM to 3:00 PM
7AM - 2PM
7am - 2pm
6am-2pm
6AM-2PM
7:00AM-3:30PM
7:00AM-3:00PM
6am-11am
6AM-11PM
7:30am to 2pm
7:30AM to 2PM
6AM to 3PM
6am to 3pm
Really sorry for not clarifying earlier, but please note that there shall be text before and after the extracted time formats. And we require solution to be able to extract the mentioned time formats from series of strings:
There are some text characters which actually has the words endingwith ‘PM or AM’ which is messing up the logic. I also tried adding space after AM/PM but that is not helping either.
Free texts are human inputted and have very weird variations to catering the list of time range formats.
Not getting what shall be the best solution around it.