Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!

Regex_replace help

Highlighted
6 - Meteoroid

Tried and read everything but still have some issue...

 

original string:  

C43351^B247~D60400^D

need to be:

C43351^B247

 

Regex_Replace([ARRAY], "[~D]d+[D]",null())

C43351^B24760400

 

Look like the number between '60400' ~D and ^D is not being replace.

Please help

 

Highlighted
11 - Bolide

Hi @truct-kp ,

 

Try 

Regex_Replace([ARRAY], "[~D]d.+[D]","")

 

Hope this helps.

Highlighted
6 - Meteoroid

Nope, I tried that before.  I even put \ before my special character, but it not working

 

Highlighted
11 - Bolide

Strange, it's working when I test it,, alternative is

 

 Regex_Replace([ARRAY], "~D.+D","") ?

Highlighted
11 - Bolide

regex.png

Highlighted
6 - Meteoroid

your suggest solution is very straightforward and I had try them and other variation as well.  

All attempts are not working.  very weird.  

Will open a case with support.

 

Highlighted
11 - Bolide

If you can, post your workflow or data extract - your data might have some end spaces or newlines etc not copying across on your original post.

Highlighted
6 - Meteoroid

Give it a shot.

 

Thank you

11 - Bolide

You have not removed the null condition from your RegEx, it is showing as: Regex_Replace([CVRG_ARRAY_TX_CHOICE],"~D.+D",null())

 

Try:

 

Regex_Replace([CVRG_ARRAY_TX_CHOICE], "~D.+D","")

 

The null() is replaced by ""

 

 

 

 

 

 

 

Highlighted
6 - Meteoroid

Sorry, please try this package

Labels