in reply to Replacing exactly the found instance in REGEX
$string = "useridagohiluserid>traderidagohiltraderidjiagohilji"; if ($string =~ /traderid(.*?)traderid/sig) { $string =~ s/(?<=traderid)$1(?!=traderid)/myword/ ; } print "$string\n" ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Replacing exactly the found instance in REGEX
by johngg (Canon) on Dec 09, 2008 at 12:52 UTC | |
by inquis (Initiate) on Dec 09, 2008 at 13:08 UTC |