Pattern matching problem in ebook-editor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
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.
('Linux', '4.4.0-57-generic', '#78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016')
Python 2.7.9
Linux: ('debian', 'stretch/sid', '')
[…]
Traceback (most recent call last):
File "site-packages/
File "site-packages/
File "site-packages/
File "site-packages/
File "site-packages/
MemoryError
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.
This is caused by a bug in the regex engine the editor uses: https:/ /bitbucket. org/mrabarnett/ mrab-regex/ issues/ 227/incorrect- behavior- for-operator- with
You will have to wait for a fix for it.
status invalid