in reply to Re: how to search and replace the match with specific number of times in a string
in thread how to search and replace the match with specific number of times in a string
$s="***ab***c"; $s=~s{\*}{\*\n} for 1..2; print$s;
it replaces first * by *\n and the rest it ignores... why can any one explain me pls?
but desired wasmy output was: * **ab***c
* * *ab***c
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to search and replace the match with specific number of times in a string
by Ratazong (Monsignor) on Jan 29, 2010 at 14:07 UTC | |
|
Re^3: how to search and replace the match with specific number of times in a string
by Verillion (Initiate) on Jan 29, 2010 at 17:30 UTC | |
by markkawika (Monk) on Jan 29, 2010 at 19:26 UTC |