Free Trial

Alteryx Designer Desktop Discussions

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

I have a regex code that needs some improvement to run the way that I want in Alteryx

fomenter
8 - Asteroid

I have this regex code(below) that I'm running in Alteryx.It is designed to parse words 

 

 

5 REPLIES 5
Federica_FF
11 - Bolide

Hi,

 

I guess you have to make the last group optional too.

 

You're looking for drive or dr or ave or avenue or lane or ln or loop or hwy, etc, etc..  but 110 Tom Main has no one of those words.

pcatterson
11 - Bolide

This isn't a totally REGEX solution, but you could trim the street names off the end prior to doing the regex parse within a Formula tool:

 

trim(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace(regex_replace([field1],'street',''),'ave',''),'avenue',''),'lane',''),'ln',''),'loop',''),'hwy',''),'circle',''),'cir',''),'plaza',''),'pl',''),'terrace',''),'blvd',''),'boulevard',''),'pkwy',''),'drive',''),'dr',''),'way',''),'road',''),'court',''),'parkway',''),'run',''),'st',''),'ct',''),'rd',''),'street',''))

 

JohnJPS
15 - Aurora

Just for kicks I turned it into a workflow where you can supply the relevant search terms. It may not fit your purposes, but should be easy to maintain when it comes to which search terms to use.

fomenter
8 - Asteroid

John,

 

It can very well replace my regex with some modifications. I wonder if there is a shortcut make text input file (Drive, Dr,Ave) case insensetive, other than typing in manually

 

Thanks bunch

JohnJPS
15 - Aurora

If you follow all input tools with MultiField formulas, and set them to target all Character fields, and replace these fields with UpperCase (or LowerCase - whichever you prefer).... then you should be able to ignore case thereafter in your workflow.

Labels
Top Solution Authors