Like this?
$s = 'a b & & * * * * a * * * *& && & xy a';; $s =~ s[(?<=\W)\s+(?=\W)][]g;; print $s;; a b &&**** a ****&&&& xy a
In reply to Re: string substitution
by BrowserUk
in thread string substitution
by Gosh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |