in reply to Re^2: Silly regex with match extrapolation
in thread Silly regex with match extrapolation

Probably not very efficient, but just count them:
use warnings; use strict; my @names = qw(bob jan mike); while (<DATA>) { my $cnt = 0; for my $name (@names) { $cnt++ if /\b$name\b/i; } print if $cnt == 3; } __DATA__ Mike went to the store with Jan. Jan, Bob and Mike ate lunch. In January, we bobbed for apples and sang into a mike.

Prints:

Jan, Bob and Mike ate lunch.