in reply to Re: Regexp problem
in thread Regexp problem

"Please consider using \A and \Z to test the entire input string."

I agree with this in principle; however, there's a subtle difference between \Z (uppercase) and \z (lowercase).

Here's a couple of one-liners to demonstrate this:

$ perl -E 'my $x = qq{qwerty\n}; $re = qr{\Aqwerty\Z}; say +($x =~ /$r +e/) ? 1 : 0;' 1 $ perl -E 'my $x = qq{qwerty\n}; $re = qr{\Aqwerty\z}; say +($x =~ /$r +e/) ? 1 : 0;' 0

See Assertions under perlre - Regular Expressions which has:

"To match the actual end of the string and not ignore an optional trailing newline, use \z."

-- Ken