|Welcome to the Monastery|
Replacing a specfied instance of a pattern in a stringby krisahoch (Deacon)
|on Jul 14, 2005 at 21:22 UTC||Need Help??|
krisahoch has asked for the
wisdom of the Perl Monks concerning the following question:
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