In case you missed the announcement: The Alteryx One Fall Release is here! Learn more about the new features and capabilities here
ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests after December 31, 2025. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

splitting of address into multiple columns using REgex

kafka_u21
7 - Meteor

I have an address column which includes Address, city, state & zip all combined into single column as example below. I needed it to be split into multiple columns, one column each for Address, City, State, Zip. how can we use regex to solve this? #Designer 

 

1060 PARK AVE APT 11A,NEW YORK NY 10211,,
8061 PEACHTREE ROAD, N.W.,SUITE 101,ATLANTA GA 60321,
100 SOUTH POINTE BEACH, APT.205,MIAMI BEACH FL 33141,
1141 5TH AVE APT 2B,NEW YORK NY 10211,
4 REPLIES 4
alexnajm
19 - Altair
19 - Altair

This article details a good example that should work for you! https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Knowledge-Base/Tool-Mastery-RegEx/ta-p/376...

i would just replace [^\d]+ with [^\n]+ since you have one address that contains a number in the street address. 

flying008
15 - Aurora

Hi, @kafka_u21 

 

Like before way of parse:

 

 

^(.+?)(?=\,[A-Z])\,([[:alpha:]\s]+)\s([[:alpha:]]{2,})\s(\d{5})\,*$

 

录制_2023_08_04_09_51_38_394.gif

 

kafka_u21
7 - Meteor

@flying008 thanks so much. you are the best. this works perfectly. any material to learn regex that you can share?

flying008
15 - Aurora

Hi, @kafka_u21 

 

Please see the post link as @alexnajm said. and you can try regex expression in www.regex101.com .

Labels
Top Solution Authors