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):
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
Solved! Go to Solution.
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.