in reply to Re: Re: looking for a regex
in thread looking for a regex
Provided you know you have enough values in @sub to match the pairs of curlies
$s ='25 {fred and barney} text 2.36 12.0 {bam bam} text {pebbles}'; $n=0; $s =~ s_\{.*?\}_{$sub[$n++]}_g; print $s; 25 {men} text 2.36 12.0 {boy} text {girl}
I'm not at all sure about using _ as the delimiter, but everything else I tried was altogether too messy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: looking for a regex
by demerphq (Chancellor) on Apr 22, 2003 at 15:25 UTC | |
|
Re: Re: Re: Re: looking for a regex
by Anonymous Monk on Apr 22, 2003 at 15:20 UTC |