virudinesh has asked for the wisdom of the Perl Monks concerning the following question:
its replace was done again and again
$li ="abbjghfg table 1 vinoth figer table2"; $f=$li; while($f=~m /table[ ]([0-9])+|table([0-9])+|fig[ ][0-9]+|fig[0-9]+/i +) { $f = $'; #print " after ----$f \n "; $match_key=$&; #print " --match : --$match_key \n "; $front=$`; $rep=$front."<aid=".$match_key.$'; print" $rep \n"; }
output come
abbjghfg <aid=table 1 vinoth figer table2 vinoth figer <aid=table2
but i tried different ways but how to do like this i dont know
need like this abbjghfg <aid=table 1 vinoth figer <aid=table2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to do replace more then one matches?
by AnomalousMonk (Archbishop) on Jun 03, 2013 at 15:06 UTC | |
|
Re: how to do replace more then one matches?
by 2teez (Vicar) on Jun 03, 2013 at 09:39 UTC | |
|
Re: how to do replace more then one matches?
by hdb (Monsignor) on Jun 03, 2013 at 09:02 UTC | |
by virudinesh (Acolyte) on Jun 03, 2013 at 09:08 UTC | |
by hdb (Monsignor) on Jun 03, 2013 at 09:39 UTC |