We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx Pattern Desired Ouputs Part 3

JonaV90
7 - Meteor

Hi,

 

Following up on part 2 -> https://community.alteryx.com/t5/Alteryx-Designer-Discussions/RegEx-Pattern-Desired-Ouputs-Part-2/m-...

*all parts are coming from one column with different variations of the string

 

I have hopefully one last task, to pull out the desired outputs from the attached data set. Just like part 2, I need 6 different outputs.

 

Please see below a sample of patterns from the data set.

 

Can someone help me pull out these 6 different columns from the one string column using one Regex tool?

 

JonaV90_1-1677186220234.png

 

Thanks,

6 REPLIES 6
BS_THE_ANALYST
15 - Aurora
15 - Aurora

@JonaV90 

BS_THE_ANALYST_0-1677188893029.png

Regex:
^([A-Z][[a-z]+)(\w+)\s(.*?)(=?\(|Truck|Van)\s*(?:\((\w+).*?\))?(?:(incl\.[a-zA-Z ]+))?(.*)

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
15 - Aurora
15 - Aurora

@JonaV90 this one is better than the other one. I made an unnecessary extra column.:

BS_THE_ANALYST_0-1677189281589.png


Regex:
^([A-Z][[a-z]+)(\w+)\s(.*?Truck|.*?Van)\s*(?:\((\w+).*?\))?(?:(incl\.[a-zA-Z ]+))?(.*)

All the best,
BS

LinkedIN

Bulien
JonaV90
7 - Meteor

@BS_THE_ANALYST 

 

I missed one desire output column. See image below

 

can you also have that one included?

 

JonaV90_0-1677195114055.png

 

Thanks,

 

JonaV90
7 - Meteor

Nvm, I got it!

 

^([A-Z][[a-z]+)(\w+)\s(.*?Truck|.*?Van)\s*(?:\((\w+)-?(.*?)\))?(?:(incl\.[a-zA-Z ]+))?(.*)

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@JonaV90 

BS_THE_ANALYST_0-1677196398879.png

^([A-Z][[a-z]+)(\w+)\s(.*?Truck|.*?Van)\s*(?:\(([a-zA-Z]+)-?(.*?)\))?(?:(incl\.[a-zA-Z ]+))?(.*)

 

All the best,
BS

LinkedIN

Bulien
BS_THE_ANALYST
15 - Aurora
15 - Aurora

@JonaV90 Great stuff. You solved your own problem! 😁. Mark your answer off as a solution aswell.

 

All the best,
BS

LinkedIN

Bulien
Labels
Top Solution Authors