Start Free Trial

Alteryx Designer Desktop Discussions

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

Regex replace everything after matching word - can you help please

ck2024
9 - Comet

Hi folks

 

I think Regex replace is the right thing to do but not quite sure how to achieve it...basically if there is a matching SPA on its own and not part of another work like SPAIN then I would want everything removed after we find that word 

 

So

KPMG SPA REVISIONE E ORGANIZZAZIONE CONTABILE

 

Would become

 

KPMG SPA

 

Could someone help please?

 

Thanks

Cass

2 REPLIES 2
atcodedog05
22 - Nova
22 - Nova

Hi @ck2024 

 

Your hunch is right. Here is the regex you can use

 

 

REGEX_Replace([Input], "SPA\s.*", "SPA")

 

 

Basically, if there is SPA followed by space and any characters replace it with SPA.

 

Workflow:

atcodedog05_0-1625476047813.png

 

Hope this helps 🙂

 

ck2024
9 - Comet

Awesome, thanks a lot @atcodedog05 

Labels
Top Solution Authors