View Single Post
Old 02-17-2014, 11:26 AM   #16
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,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
It doesn't matter, you just need to change the search expression to match both the comment and the stuff after it. If the stuff after it is of undefined form, like tags, use a start and end comment, like this:

<!-- tags --><!-- end -->

with search expression

<!-- tags -->(.*?)<!--end -->

and function

Code:
def __call__(self, m):
   return '<!-- tags -->' + tags + '<!-- end -->'

Last edited by kovidgoyal; 02-17-2014 at 11:37 AM.
kovidgoyal is offline   Reply With Quote