in reply to how to do replace more then one matches?
You mean something like this?:
Update: Why to avoid using $&, $`, or $' in your programuse warnings; use strict; my $li = "abbjghfg table 1 vinoth figer table2"; my $new_str; while ( $li =~ m/(.+?)(table.?\d)/gc ) { $new_str .= $1 . '<aid=' . $2; } print $new_str, $/; #abbjghfg <aid=table 1 vinoth figer <aid=table2
|
|---|