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

Filter dataset with regular expression

whiran
8 - Asteroid

I have attached a text input with my workflow. Can some one guide me on  how to filter rows having  only apple/apples from the column with RegEx tool

14 REPLIES 14
vizAlter
12 - Quasar

@whiran — Try this solution:

 

REGEX_CountMatches([Fruit], "Apple", 1)

vizAlter_0-1603938743941.png

 

 And, using RegEx:

vizAlter_1-1603938795784.png

 

Refer to attached the solution for more understanding:

 

Qiu
21 - Polaris
21 - Polaris

@whiran 
if you want case sensitive match, try below.Capture114.PNG

whiran
8 - Asteroid

@Qiu Yes.

vizAlter
12 - Quasar

@whiran — And use the expression below in a RegEx tool if you just want to keep the rows which have only apple/apples/Apple/Apples:

 

 

^([Aa]pple|[Aa]pples)$

 

or

 

^(apple|apples|Apple|Apples)$

 

 

And, make sure "Case Insensitive" option is unchecked.

 

Refer to updated the attached workflow:

Qiu
21 - Polaris
21 - Polaris

@whiran 
By default, it will do case-insensitive match, unless you trun on the -i switch.

Thanks for the mark.

Labels