Advent of Code is now back for a limited time only! Complete as many challenges as you can to earn those badges you may have missed in December. Learn more about how to participate here!
Start Free Trial

Alteryx Designer Desktop Discussions

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

Report: Issues with REGEX_Replace Functionality in Alteryx

tobiaspffl
5 - Atom

Hello Alteryx Community and Support,

 

I'm experiencing unexpected behavior with the REGEX_Replace function within a formula in Alteryx. When using the expression REGEX_Replace("#This", "#[a-z]+", "PLACEHOLDER"), the function returns "PLACEHOLDER". It appears that the entire string is being replaced, even though the pattern #[a-z]+ doesn't match anything in '#This'. This seems like a software bug impacting the regex functionality.

-

Additionally, I've encountered another issue with the REGEX_Replace function. When using REGEX_Replace("#This#is#An#Test#", "#[a-z]+#", "?"), the result is ?is?Test#. This outcome is incorrect based on my understanding of how the function should behave.

 

It seems that the replacement process is iterative, with the following steps (also incorporating the issue mentioned above):

  1. #This#is#An#Test#
  2. ?is#An#Test#
  3. ?is?Test#

I believe this is not the intended functionality, as one would expect with regex that the function processes the entire string and replaces all matches in a single pass rather than seemingly modifying the string iteratively. This behavior has significant implications for text processing tasks, as it affects the expected outcomes of applying regular expressions in workflows.

 

Could you please provide clarification on whether this is the expected behavior or a potential issue with the REGEX_Replace implementation in Alteryx? Additionally, any guidance on how to achieve the correct replacement in a single operation would be greatly appreciated.

 

Thank you for your assistance and support.

 

Best regards,

Tobias Pfeifle

1 REPLY 1
tobiaspffl
5 - Atom

Just figured out, that REGEX_Replace is case-insensitive, which can be changed by using this:

REGEX_Replace("#This##is##An#Test#", "#[a-z]+#", "?","icase=0"). The first issue is related to this. 

Labels
Top Solution Authors