<?xml version="1.0" encoding="windows-1252"?>
<node id="475052" title="Replacing a specfied instance of a pattern in a string" created="2005-07-14 17:22:14" updated="2005-08-14 15:55:56">
<type id="115">
perlquestion</type>
<author id="175971">
krisahoch</author>
<data>
<field name="doctext">
Monks,&lt;br&gt;
&lt;p&gt;
I have an interesting problem where I need to replace a specific instance of a word in a string.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Example String:&lt;/b&gt;Fsih my test variable is fsihd or is it gfsih or gfsihd fsih&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;Thank you in advance&lt;/p&gt;
&lt;p&gt;Kristofer&lt;/p&gt;</field>
</data>
</node>
