some bad search results using regex

Bug #1931566 reported by Alejandro
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

calibre version: 5.20
operating system : Windows 10 Pro. 21H1. 19043.1052

search results using regex: (?<!->\w+mente[. ].+)(?<!loc\. )(?<!desus.*)adv\.(?!.*desus\.)(?!.*vulg\.)

document: (attached) Diccionario de la Lengua Espano - Real Academia Espanola.epub

When i do the search, results in the search box are shown correctly. Most of them are right, but some:

1. When the result is clicked to see it into the document (main) window, another wrong result is shown.

In this document, and doing the search above, i can see the bad behaviour when i click on the first result an others.

(Maybe i'm doing something wrong and its not a bug :/)

Revision history for this message
Alejandro (catalonia-republic) wrote :
Revision history for this message
Alejandro (catalonia-republic) wrote :

Did anyone read this?

Revision history for this message
Morgan Seltzer (morganseltzer000) wrote :

Hey Alejandro, I'm looking into this right now. The regex you provided would not usually work on a regex engine because most engines, including the standard python one, only allows for fixed-length backreferences, while this part of your regex "(?<!->\w+mente[. ].+)" is not fixed-length due to the +. However, I am looking into this in more detail because the regex "^(?!->\w+mente[. ].+).*\d\.\ adv\.(?!.*desus\.)(?!.*vulg\.)" should work and do what you intend, and does work in all the regex engines I have tested, but returns no results in calibre, and furthermore calibre uses a non-standard regex engine that should actually work with your original regex.

Revision history for this message
Alejandro (catalonia-republic) wrote :

:O Thank you for the help. :P :P

I'm really sorry you had been busy with the regex. In fact, what I'm more interested of is in the 'clicked search result' fail.

I mean, i think it's not about the regex but where the search result go to when is clicked on.

I apologize for all the inconvenience.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
Alejandro (catalonia-republic) wrote :

:O AWESOME! :D

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers