Free Trial

Alteryx Designer Desktop Discussions

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

replace characters in front of a special character

chvizda
8 - Asteroid

Hi all

 

I have following string in a field:


sip:+331498850568@193.115.116.214

 

I need to anonymize the data and I want to replace the last 3 digits before the @ with ***. to have following:

 

sip:+331498850***@193.115.116.214

 

Plus I have another field:

Test User" <sip:+3317082578905@12.51.24.64>;tag=116723481~9984c3de-ee3e-47bc-bcbc-e6fe3fa0188d-61611991

 

Here I need to complete remove the strings left from <sip. and also replace the last 3 digits before the @ with *** to have:

 

<sip:+3317082578***@12.51.24.88>;tag=116723481~9984c3de-ee3e-47bc-bcbc-e6fe3fa0188d-61611991

 

I think that can be done with some regex or in the formula tool but unfortunately I don't know how.

 

If hope you have a good solution for me.

 

Thanks in advance

 

Steffen

 

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus
Regex_Replace([stuff],"(.*?)\d{3}(@.*)",'$1###$2')

Cheers,

Mark
Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
danrh
13 - Pulsar

Non-regex version --- feels a lot like excel :)  You should be able to feed either of your strings into this.

 

image.png

Labels
Top Solution Authors