Skip to main content

I have a long text field that takes the food and the preference of the user.

Sample Input:

Burgers (Enjoy), Pasta (Ok), Seafood (Nope), Pork (Ok), Beef (Ok), Vegies (Enjoy)

 

I want to get all the texts that are "Enjoy"-ed by the user.

Expected Output:

Burgers, Vegies

 

What formula can I use to get this output?

I tried to make an formula in Regex.
How does this work?

REGEX_REPLACE({Foods},"\\w*\\s\\((Nope|Ok)\\),?\\s?|\\s\\(Enjoy\\)\\s?","")

 


I tried to make an formula in Regex.
How does this work?

REGEX_REPLACE({Foods},"\\w*\\s\\((Nope|Ok)\\),?\\s?|\\s\\(Enjoy\\)\\s?","")

 


This works fine for the sample data given but isn't working for 3-words. Thanks though!


I had not verified that case!
Update for multiple words

REGEX_REPLACE({Foods},"[\\w\\s]*\\s\\((Ok|Nope)\\),?\\s?|\\s\\(Enjoy\\)","")

 


Reply