Dear Steve,
=> One clarification. The suggested workaround was not to just
=> start the regex with a ^ but to start it with ^.*
"Longest left-most match" means that anchoring with "^.*"
will replace the *last* occurrence of the LHS, instead of the
first occurrence.
In addition, the ".*" in the s/// is going to swallow leading text.
|| % perl -le '$_ = shift; print if s/^.*ab/cd/' pqrabpqrabxy
|| cdxy
|| % perl -le '$_ = shift; print if s/^.*ab/cd/g' pqrabpqrabxy
|| cdxy
|| % perl -le '$_ = shift; print if s/ab/cd/' pqrabpqrabxy
|| pqrcdpqrabxy
|| %
peace, || Let there be light:
--{kr.pA} || http://tinyurl.com/gjqs
--
Premature optimization is the root of all evil in programming. -- C.A.R. Hoare
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm