inquis has asked for the wisdom of the Perl Monks concerning the following question:
I would expect it to print the below :$string = "useridagohiluserid>traderidagohiltraderidjiagohilji"; if ($string =~ /traderid(.*?)traderid/sig) { $string =~ s/$1/myword/ ; } print "$string\n" ;
useridagohiluserid>traderidmywordtraderidjiagohilji
useridmyworduserid>traderidagohiltraderidjiagohilji
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replacing exactly the found instance in REGEX
by JavaFan (Canon) on Dec 09, 2008 at 11:30 UTC | |
by gwadej (Chaplain) on Dec 09, 2008 at 14:46 UTC | |
|
Re: Replacing exactly the found instance in REGEX
by sathiya.sw (Monk) on Dec 09, 2008 at 12:09 UTC | |
by johngg (Canon) on Dec 09, 2008 at 12:52 UTC | |
by inquis (Initiate) on Dec 09, 2008 at 13:08 UTC |