#!/usr/bin/perl

use warnings;
use strict;

$\ = $/;

$_ = <>, chomp;
@_ = map { s/^\s+|\s+$//gr } map { split m/[.]\K\s+(?=[A-Z0-9])/ } split m/[!?]\K/;

<>;

while(<>){
	chomp;
	m/\w/ or next;
    # lowercase each word and write it into look-ahead (\b - word boundary):
    my $re = join '', map "(?=.*\\b$_\\b)", map lc, m/\w+/g; 
	my @found = grep m/$re/i, @_; # i = ignore case

	print "Search results for \"$_\":";
	print "- \"$_\"" for @found;
}