ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

RegEx of 2 words

selsset97
7 - Meteor

Hi Community,

 

I am trying to parse a column with many words in the following way:

Separate the first 2 words from the rest of of the content

 

<Input>

selsset97_0-1669867091789.png

 

 

<Desired output>

selsset97_1-1669867100226.png

 

Any advice on how to do do it?

 

Thank you!

 

 

2 REPLIES 2
apathetichell
20 - Arcturus

This would be easier with:

formula tool - new field -  first two words:

GetWord([field],1)+" "+GetWord(field,2)

 

formula tool - new field - "remainder"

replace([field1],[first two words]+" ","")

flying008
15 - Aurora

Hi, @selsset97 

 

If your string include more repeat words, maybe you can use the below formula:

1- First 2 words:

REGEX_Replace([Plants], "^([[:alpha:]]+\s[[:alpha:]]+).+$", "$1")

 

2- Other last words:

Trim(REGEX_Replace([Plants], "^" + [First], ""))

 

flying008_0-1669874452546.png

 

Labels
Top Solution Authors