Need help with Regex statement for multiple date formats

Hello! I receive a formatted email with the following text, and I’m trying to use a text parser to pull the data into Google Sheets as a new row.

– Transaction Details –
Amount: $450.42
Date: 10/15/2024
Invoice: 5925702
Billing Account Name: Account123

I’d like to match for the values in each line: the amount, the date, invoice#, and billing account name. I’m having a bit of trouble successfully creating a regex statement—one detail here is that single number months (for example, June) is noted as 6/1/2024, instead of 06/01/2024. So I’m hoping to find a pattern that matches for both possible date formats. Thank you!!

Welcome to the Make community!

Could you go to regex101.com, paste in your Pattern at the top and paste a complete/full example text you are trying to match from below it?

Then, save the regex example and share the link with us here.

This will allow others to assist you here with your pattern. Thanks!

Here you go. As you can see I’m also having some issues matching some of the other values I’m looking to extract. Thanks for your help!

As you can see, you had an error in your pattern:

You need to escape special characters for it to work:

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.

1 Like

Hello @NEON_Global,
Response from @samliew is perfect as you need.
Only one thing is when there are date variances, you need to use a different pattern to handle those date values and extract them.


Check my version of the updates.
Regular expression.

I hope this helps.
:+1:

2 Likes

thank you @dilipborad and @samliew ! That did the trick. Your help is greatly appreciated!

1 Like