Thanks for the above replies..
Hi shmem
I added modifier /c also in the match. Please check the below code. But, still the pos() for regexp is not reset. Could you please help me how to reset the position for regexp variable using modifier
#!/usr/local/bin/perl
use strict;
use warnings;
my $regexp = 'Perl Monks';
print "\nPos...", pos($regexp);
if($regexp =~ m/^Perl Monks/gci) {
print "\nFound..";
} else {
print "\nNot Found..";
}
print "\nPos..1.", pos($regexp);
if($regexp =~ m/^Perl Monks/gi) {
print "\nFound.1.";
} else {
print "\nNot Found.1.";
}