in reply to Regular Expression

Hi

& is a special character one. That's why it doesn't match. Use the following:

if (($string=~m/abc/i && $string=~m/xyz/i)) { print "\nMatched"; }

Or Simply use

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