in reply to Re^2: Empty pattern in regex
in thread Empty pattern in regex
// always matches, always returns TRUE, but it never changes $&.
That is not correct, in either aspect:
% perl -wle '"a" =~ /a/; "b" =~ // or print "did not match, did not re +turn TRUE"' did not match, did not return TRUE % perl -wle '"a" =~ /.*/; q{$& changed} =~ // and print $&' $& changed %
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Empty pattern in regex
by perlboy_emeritus (Scribe) on Oct 19, 2023 at 20:44 UTC |