Ramprasad A Padmanabhan [RAP], on Wednesday, April 27, 2005 at 15:55
(+0530) thinks about:

RAP>   I want a regex to replace all continuous occurrences of '-' with
RAP> something else say 'x' except the first one

this is nearly what you want, it should be a bit improved:

my @input = ("- Ram", "-- bla", "bla ---", "-- blah ----");
print grep { s/-[^-]*-/-x/g } @input;

--

How do you protect mail on web? I use http://www.2pu.net

[(A)bort (R)etry (C)ontinue ... just kidding.]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to