Regex Replace text and Date Parser

I’m getting stumped trying to get some valid date formats from an expression. I also tried to work through the issue with some AI, but it kept failing.

I have the following input: Wednesday, July 30th (10:30 AM – 11:15 AM PT)

And I need to create 3 different times/dates from that input:
Output Examples (ISO 8601 Format):

  • date: 2025-07-30T00:00:00Z
  • start time: 2025-07-30T10:30:00Z
  • end time: 2025-07-30T11:15:00Z

I was working on a regex to extract the Month and Day so that I could then use a parse date and format date on, but the regex kept not working when I was testing it in a set variable

{{replace("Wednesday, July 30th (10:30 AM – 11:15 AM PT)"; ".*([A-Z][a-z]+) ([0-9]{1,2})(?:st|nd|rd|th)?.*"; "$1 $2")}}

Any help you can provide would be greatly appreciated!

Thanks!

Hey there,

you can use the Match Pattern module with this expression:

^(\w+),\s+([A-Za-z]+\s+\d{1,2}(?:st|nd|rd|th)?)\s+\((\d{1,2}:\d{2}\s+[AP]M)\s+–\s+(\d{1,2}:\d{2}\s+[AP]M)\s+([A-Z]+)\)

It will return several variables matching the date and the two times. From them you can build your 3 dates.

Welcome to the Make community!

You don’t need to use extra modules or the replace function.


Output:

By the way, your Output Examples are incorrect, as 10:30 AM (Pacific Time), is NOT 10:30:00Z, and similarly with 11:15 AM (Pacific Time), is not 11:15:00Z.

Hope this helps! Let me know if there are any further questions or issues.

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.

3 Likes

Sam, another home run! You are awesome. Thank you for always having great responses and responding so quickly.

2 Likes