Hey there, I have an input data that goes like this “Novermber 26th & 27th”
I am looking for a pattern where I could get the output as
1.November 26th
1.November 27th
Is this possible with patterns? If so how.
Thanks :)
Hey there, I have an input data that goes like this “Novermber 26th & 27th”
I am looking for a pattern where I could get the output as
1.November 26th
1.November 27th
Is this possible with patterns? If so how.
Thanks :)
You could do this with 2 patterns. 1 to extract the month and 1 to extract the days. The only downside i see is that you get back a list so Zapier adds some commas where there shouldn’t be and as a result you may need another step to remove the commas and clean it up.
You could also look at writing some code and doing this with a Code by Zapier step.
This is what the test of the action where we extract the date is like
Do you know why this is happening?
I am not sure why that is happening. Another approach would be to use code. (javascript)
let inputDate = inputData.dates;
output = {};
let monthMatches = inputDate.match(/January|February|March|April|May|June|July|August|September|October|November|December/g)
let dateMatches = inputDate.match(/\d{1,2}th|st|nd|rd/g)
output.month = Object.assign({},monthMatches)
output.dates = Object.assign({},dateMatches)
Thanks
Hey
So this is the input “December (3rd-17th)”
The output doesn't show “3rd”. This is the output of this action
Do you know why this happens?
Try changing this line from
let dateMatches = inputDate.match(/\d{1,2}th|st|nd|rd/g)
to
let dateMatches = inputDate.match(/\d{1,2}(th|st|nd|rd)/g)
As far as how to learn this, Regexr is a great tool for writing Regular Expressions: https://regexr.com/
The code is written in Javascript and there are a TON of resources online: https://www.freecodecamp.org/news/learn-javascript-free-js-courses-for-beginners/
and once you get used to the lingo Google becomes a great help!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.