in reply to Re: Converting multiple spaces to nbsp
in thread Converting multiple spaces to nbsp
s/(?<=\s)(\s+)/' ' x length($1)/eg
You don't need to bother with the length and /e: just substituting one space at a time and letting the /g flag take care of the repetition works fine:
s/(?<=\s)\s/ /gSmylers
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Converting multiple spaces to nbsp
by ikegami (Patriarch) on Jun 17, 2005 at 14:59 UTC | |
by Smylers (Pilgrim) on Jun 17, 2005 at 15:17 UTC | |
by ikegami (Patriarch) on Jun 17, 2005 at 15:27 UTC |