View Single Post
Old 06-18-2016, 06:55 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,417
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
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.
kovidgoyal is offline   Reply With Quote