Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

RegEx

RolandG
6 - Meteoroid

Hallo zusammen

 

Ich möchte mit dem RegEx Tool zwei Spalten hinzufügen. Die Informationen sind in einer Spalte vorhanden.

 

Alt

Name
BC297 Zürich (471)
BC186 Bern (198)
BC1364 Aarau 2nd Currency (4154)

 

Neu

BCBKName
297471Zürich
186198Bern
13644154Aarau 2nd Currency
4 REPLIES 4
alexnajm
16 - Nebula
16 - Nebula

Try this:

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @RolandG,

 

You could use, i've also attached the example.

 

.*?(\d+)\s+(.*?)\s+\((\d+)\)

 

Kind regards,

Jonathan

Jonathan-Sherman
15 - Aurora
15 - Aurora

To add a bit of understanding to the regex, effectively the \d+ searches for numbers at the start and end of the text, wrapped in the brackets to extract them. Then we're searching and extracting for any text between the two spaces after and before the set of numbers at the start and end.

Rhys_Cooper
8 - Asteroid

Hi @RolandG 

 

thank you for posting your question. This Regex parsing problem requires the following regex statement to split into the three columns:

 

 .*?(\d+) ([a-zA-Z0-9\s]+) \((\d*)\)

 

 

The regex parse tool is used to rename the fields. Since the original field shares the same name with one of the desired field names, the select tool has to be used subsequently to achieve this. Hope this solution is dynamic enough for your problem! 

 

Please see the screenshot below and solution workflow attached.

 

Regards - Rhys Cooper 

 

Screenshot 2024-02-01 152719.png

 

 

Labels