my $inf; $inf=qr/\b(??{$inf})/; print "matched" if ("abc"=~m/$inf/);