Pattern matching problem in ebook-editor
There appears to be a problem with pattern matching which I first noticed with Calibre 2.75.1 with patterns where a first part can match the empty string and a second part matches at least 2 characters, e.g. "a?yz".
Given the string "xxxxxxxyz" the resulting match is not "yz" but "xxxxxxx".
The pattern "a?y" works fine and finds "y" as one would expect.
I checked the pattern/
Reverting to Calibre 2.74.0 did not solve the problem.
Trying to replace the wrong search result with the empty string produced:
calibre, version 2.74.0
ERROR: Unhandled exception: <b>MemoryError</b>:
calibre 2.74 embedded-python: True is64bit: True
('Linux', '4.4.0-57-generic', '#78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016')
Linux: ('debian', 'stretch/sid', '')
Traceback (most recent call last):
I'm running 64-bit Calibre 2.75.1 on Ubuntu 16.04.
When I used a similar pattern with "Replace all" on a moderately-sized ebook, I had to kill calibre (loosing some edits) after the memory usage was above 7GB and the system started swapping.