View Single Post
Old 09-29-2020, 11:19 AM   #4
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,440
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The previous behavior was a bug, this is how regexes are supposed to behave, it was fixed in python 3 and hence also in calibre 5. For example:

Code:
python3 -c "import re; print(re.sub('.*', 'pp', 'a'))"
pppp

python2 -c "import re; print(re.sub('.*', 'pp', 'a'))"                                                
pp
kovidgoyal is offline   Reply With Quote