if ($mytarget =~ m/($mystring)/i) { print "It matches $1\n"; }