Ah I see your source of confusion. The number reported is the number of locations in the text that matched the search expression, not the number of replacements. There is no way to know what replacement means in function mode.
So if your search expression matches 10 places int he text and in each place your function does 2 replacements inside the matched text, the number reported will be 10, not 20.
Even in a normal search and replace, for example if you search for
a
and replace with
a
The number reported will be some thousands, but the number of actual replacements will be zero, because replacing a by a does not actually change anything.
|