- subjectInVec.replace(pos, bbGetInputSearch().length(), bbGetInputReplace());
- pos += bbGetInputReplace().length();
- } // while
+ size_t pos = 0;
+ while((pos = subjectInVec.find(bbGetInputSearch(), pos)) != std::string::npos)
+ {
+ subjectInVec.replace(pos, bbGetInputSearch().length(), bbGetInputReplace());
+ pos += bbGetInputReplace().length();
+ } // while
+ } // if