Search a substring in a string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks Jeff.. this works for me
