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

REGEX help

JohnBell
8 - Asteroid

 

I'm trying to get the desired results...see excel sample...

 

I'm using the RegEx tool...with the expression [^_]+ and output method tokenize...it's close, but since the raw data is inconsistent, I'm not getting the desired result 100% of the time...

 

Any suggestions from the REGEX experts?

 

Thanks!

 

4 REPLIES 4
PhilipMannering
16 - Nebula
16 - Nebula

Hey John,

 

Since it's always a number followed by an underscore, how about using Parse in the Regex tool and using the pattern: _(\d+)

 

I think this should work.

ponraj
13 - Pulsar

Attaching a workflow for your case. Just see if it helps. 

Workflow.PNGResults.PNG

MarqueeCrew
20 - Arcturus
20 - Arcturus

@PhilipMannering,

 

I like where you were going with your solution, but the incoming data contains records with a bonus space.

 

EXPTAS-201708-P-Scrappy Benefit Upgrade Launch_ 27708_x

Should you want to catch these using the Parse, you'll end up needing to modify the expression as:

_\s?(\d+)

This means:  I want to create a group of digits that is preceded by a dash with 0 or 1 spaces after it.

 

capture.png

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
JohnBell
8 - Asteroid

Thanks everybody!  appreciate it...that did it...

 

Regards,

John

 

Labels