6/17/21: We have completed maintenance for the Search functionality on the Community. If you are seeing any issues, please try to clear your cache first. If the issue persists please email Community@alteryx.com

Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
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
17 - Castor

@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
17 - Castor

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

Thanks for the mark.

Labels