View Single Post
Old 06-18-2016, 07: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,699
Karma: 28549304
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 online now   Reply With Quote