I am new to Alteryx, and am trying to use the Regex tool to find special characters, in a particular column.
For example, if it found any special characters that are not a square bracket, a curly bracket or a hyphen, then, those would be flagged as matches.
I would like it to start from the beginning of the word, through to the end of the word(s) and try to find any special characters that are not in the list above. The field in question can contain more than one word separated by spaces.
Solved! Go to Solution.
@sharonsal
I believe we can do it with Formula, Regex and Find and Replace Tools.
I prefer the Find and Replace Tool since it will be easy for maintenance, if you will add or reduce the special characters.
formula tool - new boolean field called match
!REGEX_Match([Field1],".*[\[\]\{\}-]+.*")
this means if there is one []{} or - it will be false - otherwise true. You could also use it in a filter tool.
Hello Qui,
Thanks very much!
Hi Apathetichell,
Thanks, for another excellent solution!
Hello,
I want to incorporate another check to also find the word in, so added this:-
!REGEX_Match([STRENGTH],".*(\sin\s)+.*")
It works by itself, but, when added to the other check you wrote (slightly amended to find + sign instead of hyphen, but, it does not work when I combine them.
So I tried:-
!REGEX_Match([STRENGTH],".*[\[\]\{\}+]+.*") or
!REGEX_Match([STRENGTH],".*(\sin\s)+.*")
Any suggestions on how to write the above checks as one or suggest why they are not working would be appreciated.
"-" isn't a special character - "+" is... so \+ is needed to search for "+"
for "in" since you don't want to tag "into" or "introvert" you do want \sin\s - it doesn't need the ()
I'd stick with your or usage to allow for individual part testing.
OK, thanks.