jaa has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use an RE to consolidate repeated words
A simplified example of my before / after;
Any suggestions much appreciated!my $before = "apples/apples_green"; my $after = $before; my $desired = "apples_green"; # I tried this, but no go! $after =~ s#^(\w+)/$1_#$1_#; print "before [$before] after [$after] desired [$desired]\n";
Regards,
Jeff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using an RE to consolidate repeated words
by GrandFather (Saint) on Aug 16, 2005 at 11:19 UTC | |
by jaa (Friar) on Aug 16, 2005 at 11:50 UTC | |
|
Re: using an RE to consolidate repeated words
by inman (Curate) on Aug 16, 2005 at 11:23 UTC | |
|
Re: using an RE to consolidate repeated words
by GrandFather (Saint) on Aug 16, 2005 at 11:16 UTC | |
by jaa (Friar) on Aug 16, 2005 at 11:46 UTC |