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.
SOLVED

Parsing Question

sjm
8 - Asteroid

I'm looking to extract certain text from a text string. In the sample data below, I'd like to extract the two character country code that comes after the first underscore. The number of characters before that first underscore will be different. 

 

Is there a RegEx expression that can help with this? Or a different solution? Thanks!

 

sample data

The Dillinger Escape Plan - Miss Machine - Relapse_US_Label_2004

The Dillinger Escape Plan - Dissociation - Party Smasher_US_Label_2016

3 REPLIES 3
GavinAttard
11 - Bolide

Hi

 

The easiest  way i think is to use the text to coloumns tool setting the delimeter to underscore. 

 

Quick, easy, regex free :-) 

 

 

 

 

Alteryx Everything, Leave no one behind.
jdunkerley79
ACE Emeritus
ACE Emeritus

I would use a Regex tool in Parse mode. The regular expression:

_([A-Z]{2})_

Will pick the first 2 capital letters surrounded by _.

 

In parse mode, it will generate a new column as a result.

 

Sample attached.

sjm
8 - Asteroid

This is perfect. Thank you!

Labels