R
Robert Wallace
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;
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;