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