regexextract all groups from list as arrayformula

Viewed 59

I'm looking for a regex arrayformula which would be able to extract all possible groups from a list. here is a visualisation:

image here

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&")")&"]"))
...
2 Answers

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)))),""))

enter image description here

enter image description here

you can fake it like this in B2:

=INDEX(IF(REGEXMATCH(A2:A5, 
 TRANSPOSE(SUBSTITUTE(A8:A10, " ", ".*"))), TRANSPOSE(A8:A10), ))

enter image description here

Related