Replace first occurance of a word
Posted: Mon Dec 04, 2006 6:03 pm
Hi,
I have one small problem, I want to replace the first occurance of a word with another word.
I use replace function with regex expression \bword\b to find the word when it is not part of another word, however it replaces every occurrence of the word when I just want to replace the first occurrence.
Oh yea one other thing, I would like to replace a word beside a full stop '. '(This works fine) However if the word is part of a link eg. http://www.word.com then the word gets gets replaced. Surely I can put some check to prevent this from getting replaced?
I have one small problem, I want to replace the first occurance of a word with another word.
I use replace function with regex expression \bword\b to find the word when it is not part of another word, however it replaces every occurrence of the word when I just want to replace the first occurrence.
Oh yea one other thing, I would like to replace a word beside a full stop '. '(This works fine) However if the word is part of a link eg. http://www.word.com then the word gets gets replaced. Surely I can put some check to prevent this from getting replaced?