Wednesday, October 12, 2011

Escape regex characters in string match

$rex = qr{\Q(hi/\E}is;



my $string='(Hi/';
if($string=~m/$rex/is)
{
print "Matched\n";
}



No comments:

Post a Comment