use warnings; use strict; my $str = "It is very very cold now"; $str =~ s/(?<! ) (?! )//g; print $str;
Prints Itisvery verycoldnow which I doubt is what you want, but is what you asked for.
In reply to Re: Regular Expressions: Removing 'only' single spaces from a string
by GrandFather
in thread Regular Expressions: Removing 'only' single spaces from a string
by BioBoy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |