in reply to Re^2: Regular Expressions: Removing 'only' single spaces from a string
in thread Regular Expressions: Removing 'only' single spaces from a string
or you could use $str =~ s/\b \b//g;
...only if all the *non-space* characters are *word* characters:
my $str = '@@@@ $$$ *** )))'; $str =~ s/\b \b//g; print $str;
|
|---|