substitute two ore more with two or more
From: Robert Wallace (robw_at_sofw.org)
Date: 12/31/03
- Next message: Larry: "Re: LWP::Simple Not Working"
- Previous message: Larry: "Re: LWP::Simple Not Working"
- Next in thread: Big and Blue: "Re: substitute two ore more with two or more"
- Reply: Big and Blue: "Re: substitute two ore more with two or more"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 11:31:59 -0500
I want to find two or more spaces and replace them with the same number
found.
I there are three items found, replace them with three other items. four
for four, etc...
If I have:
$x="<img src='pic.gif'> a b c d";
and I want to output:
<img
src='pic.gif'> a b c d
I thought this would work:
$x=~s/ {2,}/ /g;
but that replaces all two or more spaces with one
these didn't work
$x=~s/ {2,}/$1/g;
$x=~s/ {2,}/(($1)x3)/g;
- Next message: Larry: "Re: LWP::Simple Not Working"
- Previous message: Larry: "Re: LWP::Simple Not Working"
- Next in thread: Big and Blue: "Re: substitute two ore more with two or more"
- Reply: Big and Blue: "Re: substitute two ore more with two or more"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]