Now that it's live, don't forget to accept your certification badge on Credly today! Learn more here.
We are currently experiencing an issue with Email verification at this time and working towards a solution. Should you encounter this issue, please click on the "Send Verification Button" a second time and the request should go through. If the issue still persists for you, please email support@alteryx.com for assistance.

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
SOLVED

How to parse text from a string that contain special character, text and number

minniiko
5 - Atom

Hi everyone,

 

I'm trying to parse a set of data that has the Account Description in this format:

 

Car Parking Sales (Cash) (105)

Project Expense (External) (104.2)

Transportation - Others (Deployment) (444.95)

 

I want to parse it to separate the text details (including "-") from the number in parenthesis. 

 

Could you please help?

3 REPLIES 3
cmcclellan
13 - Pulsar

There might be a cleaner way, but this works .... 

 

([a-zA-Z\ \(\)\-]*)(\d*\.*\d*)

 

cmcclellan_0-1631234525400.png

 

ncrlelia
11 - Bolide

Hi @minniiko,

 

My suggestion would be (.+)\s\((\d+.*\d+)\)

 

  1. (.+) 
    • .+ = the character before the numbers
    • () helps to identify the value to parse (i.e. output)
  2. \s = the space between the text and numbers
  3. \((\d+.*\d+)\)
    • \d+.*\d+ = numbers in the brackets, including "." if any
    • () identify the value to parse
    • () = to the original brackets for the numbers, added \ to escape the special characters. This is not include within () as we do not want it in the output.

 

ncrlelia_0-1631236112811.png

 

Hope this helps.

 

Cheers,

Lelia

minniiko
5 - Atom

This works like a charm!!! Thank you both so much! Cheers!

Labels