Alteryx Designer Desktop Discussions

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

RegEx Certain Words

tf05
7 - Meteor

I have the below coming out of our database and I need to separate each phrase into a new column. 'Wants' is a common word to the start of each phrase so I have been trying RegEx to try and get the desired outcome.

 

Input:
Wants more details on this property Wants to view this property Wants an online viewing Wants more details on this property Wants to view this property

 

Output:

Wants more details on this property

Wants to view this property

Wants an online viewing

Wants more details on this property

 

Any advise on the expression to use would be appreciated. Thank you

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @tf05 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1648476469287.png

 

Hope this helps : )

 

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @tf05 

Cheers and have a nice day!

binuacs
20 - Arcturus

@tf05 similar to @atcodedog05 solution but using regex tokenize

binuacs_0-1648477648574.png

 

MarqueeCrew
20 - Arcturus
20 - Arcturus

@tf05 ,

 

In reviewing your post, I didn't see a solve that helped to explain the solution.  I've posted a YouTube video and will include a brief narrative here.

Essentially you want to list the demands (wants) included in your input as single asks.  For the sample data, each request starts with Wants.  But "certain words" leads me to thinking that there could be other text.  If we limit ourselves here to the string having a Capital letter to begin each sentence, we can parse the data.

 

I'll demonstrate a non-RegEx way to do this for "FIXED" strings.  I'll then move to how to get to the final solution via RegEx.  I'll use a TRIAL & ERROR approach.  Nothing is as easy as looking at a final solution, but knowing that it got there on a bumpy path might make you see that learning is something to share.

 

Here's the video followed by a picture followed by CHEERS 🍻 followed by a workflow.

 

 

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
atcodedog05
22 - Nova
22 - Nova

Hi @MarqueeCrew 

 

Noted, thanks for the improvement tip. I realized about this mistake after seeing @binuacs solution 😅

Labels