Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
ALTER.NEXT:

Join us on Dec 2 for a half-day virtual analytics + data science event!
US & CA customers only

SAVE YOUR SPOT
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
SOLVED

Get all words that come between 2 substrings

Highlighted
Alteryx Certified Partner

I have a table and one column has text like 

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Consumer contact information: John Doe (xxx)xxx-xxxx. Name of organization: Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

From this text, I only want "John Doe (xxx)xxx-xxxx.". 
Is there a way to get data that comes between the substrings Consumer contact information and Name of organization.
The text that comes before Consumer contact information can be of varying length.

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner

RegEx to the rescue here. Try the following expression in a RegEx tool in Parse Mode:

 

(?<=Consumer contact information: )(.*)(?= Name of organization:)

 

RegEx breakdown:

The overall structure is that you're identifying a beginning marker, then saying you want any characters that come next until the next marker comes along. Each of these three "steps" is bound by parenthesis in the statement above.

 

The attached workflow shows this in action.

Highlighted
Alteryx
Alteryx

Hi @smarapad 

 

You can use the regex tool to solve this problem. I have attached a workflow that completes this task.

 

Here is documentation on the regex tool.

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689

 

Let me know if this is helpful.

 

Luke

 

Labels