Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Remove a specific text pattern from string

soncoku
9 - Comet

Hey everyone.
I have a list of account names that I need to match with another one.

 

Some of the names in the list are names in the regular format NAME Middle_Name and  Last_name
but some other have an ID in front, like:

#3193 Geroge Washington

or maybe

#3193-2 Geoge Washington

etc

 

So what I need exactly is a regex formula that when it finds this pattern (#4digit nr ) it removes it and leave everything else

5 REPLIES 5
Emil_Kos
17 - Castor
17 - Castor

Hi @soncoku,


I am relly basic with regex but it should work.

 

Emil_Kos_0-1611842312917.png

The output:

 

Emil_Kos_1-1611842332317.png

 

 

 

neilgallen
12 - Quasar

if the strings only contain numbers and the "#" symbol on the front end, why not use the data cleanse tool set to remove numbers and punctuation? This would leave the name only.

soncoku
9 - Comet

@Emil_Kos 

This is pretty much it. but if it has #3110-2 Washington George I need the output to be 2 Washington George.

So it needs to remove #3110-  and leave 2 Washington George

soncoku
9 - Comet

@neilgallen 

yes but some profiles have the 4 digit ID after the name and I don't want that removed

Emil_Kos
17 - Castor
17 - Castor

Hi @soncoku,

 

My solution is even better now. I would even say that I like it 😄

 

Emil_Kos_0-1611843907441.png

Emil_Kos_1-1611843913066.png

 

Labels
Top Solution Authors