Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

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
14 - Magnetar

@JonaV90 

BS_THE_ANALYST_0-1677188893029.png

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

BS_THE_ANALYST
14 - Magnetar

@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 ]+))?(.*)

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
14 - Magnetar

@JonaV90 

BS_THE_ANALYST_0-1677196398879.png

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

 

BS_THE_ANALYST
14 - Magnetar

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

 

Labels