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

Parsing with Regex - A newbie dilemma

TravisJWhite
7 - Meteor

Hi Everyone,

 

I am new to Alteryx so please bear with me!

 

I am in the process of creating my first app and a portion of it involves parsing some data using Regex.  I've managed to stumble my way through most of it, but one particular series has caused me to see expert advice here!  

 

An example of the data: 

 

The Guide Zones 62001, 62061, ZONE000076 & ZONE000187
SPOKESMAN-REVIEW Zone 00015, Zone 00017,Zone 00076, and Zone 00077

 

I am trying to parse out the words at the beginning of each line that occur to the LEFT of any string containing 'zone'.

 

I can get success pulling out anything containing 'zone' using the expression: (zone*.+)  -  however, when I try to pull the data that occurs BEFORE an instance of 'zone' using the expression: (^.+)  -  I get EVERYTHING but the right-most occurance of 'zone'.

 

What am I missing??

 

Thank you in advance!

 

TJW

 

2 REPLIES 2
jdunkerley79
ACE Emeritus
ACE Emeritus

(^.+) is a greedy expression.

 

In other words, it takes as much as it can.

 

If you use (^.+?) then it will not be greedy and match only as far as the first zone.

TravisJWhite
7 - Meteor

Thank you so much - it worked like a charm!

Labels