Perl Monk, Perl Meditation | |
PerlMonks |
Greedy modifier found to be working non-greedy in a named groupby rkabhi (Acolyte) |
on Nov 29, 2019 at 10:09 UTC ( [id://11109425]=perlquestion: print w/replies, xml ) | Need Help?? |
rkabhi has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I am new to named groups in Perl regex. I am using perl 5.16.0 Below code works as expected:
Replacing '.' with 'e' in regular expression above leaves matched pattern as blank at the beginning:
I was expecting output of above code to be => 'eeee' is matched pattern Please enlighten why the output is different? Is the * modifier becoming non-greedy or is there any other way to understand this?
Back to
Seekers of Perl Wisdom
|
|