in reply to Re^4: Converting multiple spaces to nbsp
in thread Converting multiple spaces to nbsp
something like s/und/underground/g would get stuck in an infinite loop.
No, because the position variable changes. For in-place substitution, it would move by length('underground'). Otherwise, it would move by length('und').
I made the assumption that the substitution was done in place (since the syntax seems to imply it). You've shown me that's not the case, but it could have been written that way. (Although magic variables would need to be treated specially.)
|
|---|