Alteryx Designer Desktop Discussions

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

Regex to pull a string between a comma

Wynn
8 - Asteroid

Capture.JPG

I'm not sure what I'm missing in this formula as I just wanted to pull the street name only, not including the "suite" part. Could you please look into this? Thank you !

3 REPLIES 3
fmvizcaino
17 - Castor
17 - Castor

Hi @Wynn ,

 

The only thing missing is the comma as a delimiter of your regular expression. Example attached.

([^\d]+)?,

 

Best,

Fernando Vizcaino

estherb47
15 - Aurora
15 - Aurora

Hi @Wynn 

 

You can try to add a comma and .+ outside of the parenthesis

 

I'd also add ? inside the closing parenthesis so it's not greedy and stops at the first comma.

 

So, ?),.+

 

Cheers!

Esther

estherb47
15 - Aurora
15 - Aurora

One more idea. You can do this without RegEx too. Use Text to Columns, using a comma as the delimiter, and separating into 2 columns. Drop the second parsed column with a select tool. Then use Data Cleansing to remove the number from the address field, which will leave you with the street only.

 

Cheers!

Esther

Labels