good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
You won't believe what this regular expression does!by salva (Canon) |
on Feb 25, 2021 at 10:44 UTC ( [id://11128774]=perlquestion: print w/replies, xml ) | Need Help?? |
salva has asked for the wisdom of the Perl Monks concerning the following question:
Well, at least, it has surprised me:
What is happening is that the regular expression matches the o at the end of the line, replaces it and then it matches the empty space at the end of the line and replaces it again. But that's not what I would expect. I think that once $ is matched, Perl should continue matching in the next line. What's your opinion?
Back to
Seekers of Perl Wisdom
|
|