![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Replacing a specfied instance of a pattern in a stringby krisahoch (Deacon) |
on Jul 14, 2005 at 21:22 UTC ( #475052=perlquestion: print w/replies, xml ) | Need Help?? |
krisahoch has asked for the wisdom of the Perl Monks concerning the following question:
Monks, I have an interesting problem where I need to replace a specific instance of a word in a string. Example String:Fsih my test variable is fsihd or is it gfsih or gfsihd fsih I may want to replace the third instance of 'fsih' with 'fish', or the fourth, or even the last. How would you do that? I have tried several ways (regexp) but I failed each time. Thank you in advance Kristofer
Back to
Seekers of Perl Wisdom
|
|