Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

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
10 - Fireball

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
10 - Fireball

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

 

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

Highlighted
10 - Fireball

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
10 - Fireball

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

Highlighted
10 - Fireball

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