I have an array of paragraphs and an array of keywords. I want to iterate over the paragraphs array and return true
for elements that include all of my keywords. The keywords can be in any order, but all of them must be found in the same paragraph in order for it to be true
, not just some of them.
Is there a way I can do this using one Regexp.union
or one regex, without =~ regex1 && =~ regex2 && =~ regex3 && =~ regex4
etc?