Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Regex replace is truncating string at the end

GJNom
6 - Meteoroid

I am new to Regex. My input string in Text Input Tool is "Ha HaHa". I am using Regex replace to replace \bHa with "Bar". Case insensitivity check is also on. What I expect it to show in output is "Bar BarHa" as \b would identify the word boundary so \bHa would replace only first two "Ha". The output that I am getting is "Bar BarH". Could anyone please explain where I am going wrong and what is actually happening here?

4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @GJNom 

 

This could a possibility that this a data type size issue which is truncating your string. Try using select tool and increasing the string size.

atcodedog05_0-1621103628856.png

 

I tried same regex as yours and it working for me.

 

atcodedog05_1-1621103568023.png

 

Hope this helps 🙂

 

atcodedog05
22 - Nova
22 - Nova

And thank you sharing the usage of \b. Its the first time i am coming across it. It has a great usage 🙂

GJNom
6 - Meteoroid

Thanks @atcodedog05 . It was indeed the data type size issue. I increased the size and it worked. 🖖

GJNom
6 - Meteoroid

No problem. I am glad that you got to know about it through me. Sharing is caring! Enjoy its usage. 🤝

Labels