Skip to main content
Question

Need Help with Extracting Specific Text Using Zapier Formatter's Extract Pattern Action

  • May 23, 2023
  • 2 replies
  • 619 views

 

 Hello Zapier Community,

I'm currently facing a challenge in extracting a specific part of a text string using Zapier Formatter's "Extract Pattern" action. Specifically, I need to extract the text that is sandwiched between the penultimate and final occurrence of the symbol '»' in a given string.

For instance, given the string 'עבודות אקדמיות » עבודות בחינם » למידה רגשית חברתית »', I aim to isolate and extract 'למידה רגשית חברתית'.

My current approach involves using Python's regular expressions. I tried using the following pattern in the Formatter's "Extract Pattern" action:

`'» ([^»]*) »$'`

The idea was to find the last occurrence of a string that starts with '» ', then includes any characters that are not '»' (this is what `[^»]*` does), and ends with ' »' at the end of the line (this is what `$` signifies).

However, this solution hasn't worked for me within Zapier. I would greatly appreciate if anyone could guide me to correctly write the regular expression or suggest an alternate solution for this problem. Thank you! 

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

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • May 24, 2023

Hi @osho 

Good question.

An alternative approach would be to use AI to parse the string.

Try OpenAI or ChatGPT in a Zap step with a prompt.


  • Author
  • Beginner
  • May 24, 2023

This is exactly what i did.