c:\@Work\Perl\monks>perl -wMstrict -le "my $urlresult = 'an Alt Img and another ALT IMG here'; print qq{string has 'alt img': '$urlresult'}; ;; if ($urlresult =~ s/(alt img)//igm) { print qq{string had 'alt img', but no more: '$urlresult'}; } " string has 'alt img': 'an Alt Img and another ALT IMG here' string had 'alt img', but no more: 'an and another here'