Skip to main content
Best answer

Can you use AND/OR with 'Extract Pattern'?


I’m making a zap where users will send a message in Discord including a time. The zap is meant to find that time and create a calendar event based on it. The only issue is that it’s hard to get people to use the exact correct time format to match the pattern I put in with Python Regex. This is what I currently have to match this format (00:00PM): \d\d:\d\d\w\w
 

I’d like to have this search for multiple patterns: \d\d:\d\d\w\w OR \d:\d\d\w\w OR \d\d:\d\d\s\w\w OR \d\d:\d\d\s\w\w but it doesn’t seem the OR command is working. I would like to know if this is possible and if not, is there a workaround?

 

Thanks!

Best answer by Danvers

Hi @innate!

I’m by no means a regex expert, but some Googling suggest that the OR command should be a pipe character (as opposed to the word ‘or’) is that what you’ve been using? I apologise if you have and you were just translating for folks!

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Danvers
Forum|alt.badge.img+12
  • Zapier Staff
  • 3731 replies
  • Answer
  • August 23, 2022

Hi @innate!

I’m by no means a regex expert, but some Googling suggest that the OR command should be a pipe character (as opposed to the word ‘or’) is that what you’ve been using? I apologise if you have and you were just translating for folks!


  • 0 replies
  • August 23, 2022

Thank you so much this was exactly what I needed.