Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Check out our powerful new search update! You can read more here. Please let us know if you have any feedback by creating a topic here.

Regex_replace help

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

Hi @truct-kp ,

 

Try 

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

 

Hope this helps.

Highlighted
Meteoroid

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

 

Highlighted
Fireball

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

 

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

Highlighted
Fireball

regex.png

Highlighted
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
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
Meteoroid

Give it a shot.

 

Thank you

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
Meteoroid

Sorry, please try this package

Labels