Reputation: 33
I'm looking for a regex arrayformula which would be able to extract all possible groups from a list. here is a visualisation:
so far I tried:
=ArrayFormula(REGEXEXTRACT(A2:A6, "["&TEXTJOIN("|", 1, A8:A)&"]"))
=ArrayFormula(REGEXEXTRACT(A2:A6, "[("&TEXTJOIN("|", 1, A8:A)&")]"))
=ArrayFormula(REGEXEXTRACT(A2:A5, "["&TEXTJOIN("|", 1, "("&A8:A&")")&"]"))
...
Upvotes: 3
Views: 76
Reputation: 1
you can fake it like this in B2:
=INDEX(IF(REGEXMATCH(A2:A5,
TRANSPOSE(SUBSTITUTE(A8:A10, " ", ".*"))), TRANSPOSE(A8:A10), ))
Upvotes: 3
Reputation: 75870
Just a little out of the box maybe, but what if you tried in B2
:
=ARRAYFORMULA(IFERROR(TRANSPOSE(FILTER(A$8:A,ISNUMBER(SEARCH(SUBSTITUTE(A$8:A," ","*"),A2)))),""))
Upvotes: 3