oo! That's unexpected! I didn't realize that the previous substitution failed to affect (?<=...). s/(?<=\s)\s/ /g had occured to me, but I had dismissed it. ++!
local $\ = "\n"; local $_ = ' '; s/(?<=\s)\s/ /g; print; print($_ eq ' ' ? 'correct' : 'wrong'); __END__ correct
In reply to Re^3: Converting multiple spaces to nbsp
by ikegami
in thread Converting multiple spaces to nbsp
by eastcoastcoder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |