Alteryx Designer Desktop Discussions

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

Identify text wildcard

SergioWW
6 - Meteoroid

Hello,

 

I would like to identify text in my raw data as a wildcard that will match text in a find replace. Please see example below:

 

Raw Text 1
*/build
samplesite.com/*/locator*

 

Raw Text 2
samplesite.com/sample/build
samplesite.com/page1/locator/ny
samplesite.com/web/build 
samplesite.com/build 
samplesite.com/web/locator/nj
samplesite.com/load/locator/pa

 

Output

*/build samplesite.com/sample/build
*/build samplesite.com/web/build 
*/build samplesite.com/build 
samplesite.com/*/locator*samplesite.com/page1/locator/ny
samplesite.com/*/locator*samplesite.com/web/locator/nj
samplesite.com/*/locator*samplesite.com/load/locator/pa

 

Thanks for the help!

2 REPLIES 2
grossal
15 - Aurora
15 - Aurora

Hi @SergioWW,

 

that's a nice problem and here is a way to solve it!

 

grossal_0-1585692671173.png

 

Let's explain what happens:

 

1) Select Tool

You probably won't need this, but the Text Input tool reduces the Data length of the text to the minimal length.

 

2) Formula Tool

We need to make this a proper Regex-Expression, that's why we replace the * with .* 

 

3) Append Fields

Let's build all possible combinations of both rows

 

4) Filter

We filter the data with a Regex_Match expression saying "[Raw Text 2] needs to fulfill the regex from [Raw Text 1]".

 

 

I'll attach the workflow. Let me know if this is what you are looking for 😃

 

 

Best

Alex 

SergioWW
6 - Meteoroid

Thank you, this worked. Would you have to account for other Regex special characters in the text? (Ex: "." as "\." )

Labels