Hello all,
I've noticed some strange regex behaviour in Alteryx, namely when using capture groups as compared to regex101. Please see the screenshots below:
Using this formula
REGEX_Match([test], "(h)")
In Alteryx:
In Regex101:
Alteryx does not seem to be picking up anything except for JUST "h". I found an easy workaround by using the following regular expression, which does work in Alteryx:
.*(h).*
But the question still stands, why is Alteryx inconsistent with Regex101? I thought it may have something to do with flags but I'm not sure if that's the case.
For context:
Thanks in advance for any help!
OMG! I had this exact problem this morning - admittedly I was writing Python (not using Alteryx) but it's the same thing. I found this:'
https://stackoverflow.com/questions/180986/what-is-the-difference-between-re-search-and-re-match
but in your case, this is more appropriate:
https://community.alteryx.com/t5/Alteryx-Designer-Desktop-Discussions/Regex-match/td-p/434001 (the last line states: If appears that Regex_Match has to match the entire field in order to return true, whereas Regex_replace acts on any part of the field. )
I just can't get regex101 to replicate what I was doing.
The solution is really:
REGEX_Match([test], ".*(h).*")
Hi, @corkddd
In Alteryx, use REGEX_Match function to must be match the entire field.
In RegEx101, just match any-part of string.