One way that seems to do what you're looking for:
print "$_\n" for grep {$_ =~ /$regex/} @lines;
In reply to Re^3: matching multiple patterns in one line
by stevieb
in thread matching multiple patterns in one line
by jose_m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |