in reply to Regular Expressions: Removing 'only' single spaces from a string
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expressions: Removing 'only' single spaces from a string
by GrandFather (Saint) on Oct 20, 2005 at 18:30 UTC | |
by Not_a_Number (Prior) on Oct 20, 2005 at 18:48 UTC | |
by BioBoy (Novice) on Oct 20, 2005 at 18:46 UTC | |
by Trix606 (Monk) on Oct 20, 2005 at 20:28 UTC | |
by Roy Johnson (Monsignor) on Oct 20, 2005 at 23:32 UTC | |
by GrandFather (Saint) on Oct 20, 2005 at 19:32 UTC |