I want to join with a comma several words than can be found in a cell by joining them with a comma.
For example, from a cell that contains :
i want to use sheets to create events in calendar through gmail.
I want this output : sheets, gmail, calendar
I tried a regexreplace like this:
=ArrayFormula(IFERROR(REGEXREPLACE(LOWER(A2:A);"(.)?(sheets|calendar|gmail)?";"$2, "))))"
But I get various results like this : , , , , sheets, , , , , , , , , , calendar, , , , , , , , , , , sheets, , , , , gmail, , , , , , , , , , , , gmail, , , calendar, , , , , , , , , , ,
I would like to know how to clean it like this: sheets, calendar sheets, gmail gmail, calendar
to get rid of the useless commas before in between and after so far, using a more complex formula, i can get this :
=ArrayFormula(IFERROR(REGEXREPLACE(REGEXREPLACE(MINUSCULE(A2:A);"(.)?(sheets|calendar|gmail)";"$2, ");"(, )+";", ")))
Still, the result is not perfect, since i get this : , sheets, calendar, , sheets, gmail, , gmail, calendar,
And I am using twice the regexreplace formula. By the way, i could do it using join, or textjoin, but it is not working with arrayformula for a whole column, so it would not be appropriate.
I think this is possible using () to capture elements, but I know some are real experts when it comes to this regex!
Do you have an idea ?