bugfix for shifting replace values

If using a normal 'search' and 'replace' several times e.g. searching for 
``date_format_short

and replace it with
``datetime_format

and the search term is existing several times in the file, the first repalcement is correct, but every following match is shifting to the right (the value of $i).