asdtjhkl
asdtjhkl

Reputation: 33

regexextract all groups from list as arrayformula

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

Upvotes: 3

Views: 76

Answers (2)

player0
player0

Reputation: 1

you can fake it like this in B2:

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

enter image description here

Upvotes: 3

JvdV
JvdV

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

enter image description here

enter image description here

Upvotes: 3

Related Questions