You want to check all patterns against all lines. That's two loops.
To avoid printing the same line more than once, you could join the patterns into one. That moves one of the loops into the regex engine.
In reply to Re: comparing two arrays and displaying scalar matches
by ikegami
in thread comparing two arrays and displaying scalar matches
by pipeops
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |