in reply to Re^4: Empty pattern in regex
in thread Empty pattern in regex
Of course, you are probably right, but why did this work?
% perl -le 'print for a .. z' | perl -nle 'if (/d/ .. /h/) { next unless "m//"; print }'
d
e
f
g
h
Is that just interpolation at work? Do we have to read the source code to understand what is going on here, or is supposed to be going on? Talk about ambiguity... I tried //; m//; and "m//;" on that Foy code I reported and none yielded a successful match. Every example reported:
No nothing $1: $2: $3: $&: Perl
the value from the previous successful match.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Empty pattern in regex
by choroba (Cardinal) on Oct 19, 2023 at 14:55 UTC |