if ($string=~m#(abc).*?(xyz)#i) { print "\nfound"; }