Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

RegEx Examples - 12 Handy Use Cases

brianprestidge
8 - Asteroid

A lot of data prep questions I get asked about seem to come back to the same answer - "Use Regex!"

 

However, RegEx isn't exactly easy to understand for someone who has never come across it before.

 

This is how I started out, but by dissecting other peoples' uses of RegEx, I started to understand how RegEx works and now I seem to use it in pretty much every workflow I create (slight exaggeration).

 

So I decided to upload the attached workflow that has 12 use cases for RegEx for you to use, adapt, learn from and improve on. Please download the attached Alteryx workflow and explore what's going on and you'll soon be more than comfortable with RegEx too!

 

I've also put some useful RegEx links on the original blog for this workflow here: http://www.theinformationlab.co.uk/2016/10/27/regex-practice-using-alteryx/

 

Feel free to upload your use cases for RegEx on this discussion post, along with examples, and perhaps we can start to create a small repository for everyone - from RegEx newbies to those highly skilled in this complex but extremely useful tool.

15 REPLIES 15
MarqueeCrew
20 - Arcturus
20 - Arcturus

@priyanka31 

 

don't use regex:

 

FileGetExt

FileGetExt(Path): Returns the extension of the path, including the . (period).

Example

FileGetExt(C:\Temp\Data\file.csv) returns ".csv".

FileGetExt(C:\Temp\Data) returns " ".

FileGetFileName

FileGetFileName(Path): Returns the name portion of the path, without the extension.

Example

FileGetName(C:\Temp\Data\file.csv) returns "file"

FileGetName(C:\Temp\Data) returns "Data"

 

cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
MikeN
Alteryx Alumni (Retired)

Looking to parse this out (where the solution will dynamically pick up any subsequent values with a percentage sign and the subsequent 1 or 2 digit numbers) :

 

.5%/10, Net30

.7% 10, NET 30

1%/15, Net 30

 

Returning 2 columns.

Column 1

.5%

.7%

1%

 

Column 2

10

10

15

priyanka31
7 - Meteor

Thanks alot !!!! 🙂

RodLight
8 - Asteroid

Deleted - already answered

 

Qiu
20 - Arcturus
20 - Arcturus

@brianprestidge 
This is awesom. Thank you so mcuh!

choang4
6 - Meteoroid

@brianprestidge Thanks for sharing.

Labels