Skip to main content
Question

Regex not extracting currency from a text string

  • February 18, 2025
  • 3 replies
  • 11 views

I’m trying to extract currency from a text string but I get false returned.

I’m using [[:punct:]]currency[[:punct:]]:[[:punct:]]\s*(\w+) to extract GBP from the below text string:

{"product":["IR Forum \u2013 AI & Technology Europe - Corporate second release rate (Amount: 0.00 GBP, Quantity: 1)"],"currency":"GBP","tax":"0.00","total":"0.00","coupon":"VIPGUEST","stripeData":

Any advice?

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • February 18, 2025

Hi ​@PaulOC 

Here’s a different approach:

  • Action: Formatter > Text > Split
    • Split by: “currency”:”
    • Segment Index: Last
  • Action: Formatter > Text > Split
    • Split by: “
    • Segment Index: First

  • Author
  • New
  • February 18, 2025

Hi Troy,

Thanks for your quick response - I will try this tomorrow.

Kind regards

Paul

 


Troy Tessalone
Zapier Orchestrator & Solution Partner
Forum|alt.badge.img+14
  • Zapier Orchestrator & Solution Partner
  • February 18, 2025

@PaulOC 

If you want to use regex, try this regex:

"currency"\s*:\s*"(\w+)"