Saturday, November 19, 2011

How do i search a substring consisting of ^ ina string in perl?

I have a line = SGFD^FS . I want to find out if the string consists of FD^FS.


I wrote $line =~ /FD\^FS/ but it does not work.


$line =~ /\^FS/ works.|||my $line = q{SGFD^FS};


if ($line =~ m/FD\^FS/)


{


print "match!\n";


}

No comments:

Post a Comment