Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Search a substring in a string

sakshim
7 - Meteor

Hi,

 

I have a filename as  DF_LOCASIAS_202003.xlsx in a column extracted using Directory tool. I need to filter the column for string "DF_LOCASIAS_202". 

 

Also Please help how to use search substrings in a string/text having different scenarios like combination of alpha numeric, string having special characters, specific string followed by special character or number etc.

 

thanks in advance for your help.

 

Regards

5 REPLIES 5
jeff_reynolds
10 - Fireball

There are a bunch of ways you could do that, so in the attached workflow, I've given you few different options. Hope this helps.

 

Good luck. 

sakshim
7 - Meteor

Awsmmm!!!

 

 

this works for me ....I need to learn this finding string function, can you please help me with any link or documentation which could majorly cover Regex tool in detail.

 

Regards

sakshim
7 - Meteor

Hi Jeff,

 

Sorry, a small problem please. my folder has many files with partial same or different names. I have tried " \<DF+_LOCASIAS+_(2020\d\d.+)" but when I run, it throws an error "saying "DF_ApacAllocMH202004.xslm" did not match the regular expression" . Please note, this is the first file in my folder.

jeff_reynolds
10 - Fireball

The reason it's throwing an error is that the pattern has changed. Basically, we wrote a pattern that looked for:

 

filename_(somedate)

 

The file name you mentioned is slightly different than the pattern I built. RegEx is all about looking for the patterns....

 

filename(somedate)

 

That underscore is the difference. I updated the workflow to account for that.

 

As for RegEx, it's actually not something unique to Alteryx, and it's been around for a long time (I first encountered it back in 1998)

 

It's ridiculously powerful, and can be super tricky to work with. The site below is a good resource to practice and learn more. When I'm building an expression, I like to cut and paste example data here, and then build it out. Once I get it doing what I want, I use that working expression in Alteryx. 

 

https://regex101.com/

 

If you search for 'RegEx Books' on Google, you will see a wide variety of choices. I'm sure there are far more books on RegEx than there are on Alteryx!

 

Good luck!

 

 

 

sakshim
7 - Meteor

Thanks Jeff.. this works for me

 

Labels