Book convertion loading regexPDF to epub

Bug #1827198 reported by Marc Burger on 2019-05-01
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Undecided
Unassigned

Bug Description

When trying to load regular expressions in the converter, we get the error below (see on W10 64 bits and Linux)

calibre, version 3.41.3
ERREUR : Échec lors de la lecture: Échec du chargement des motifs à partir de E:\Ebooks\Paramètres\numero_page.csr, cliquer sur "Afficher les détails" pour en apprendre davantage.

Invalid regular expression: u'\\1 \\2' from file: u'E:\\Ebooks\\Param\xe8tres\\numero_page.csr'

Marc Burger (71marcjacques) wrote :

Attach the .csr file you are trying to load

 status incomplete

Changed in calibre:
status: New → Incomplete
Marc Burger (71marcjacques) wrote :

Here it is.

Kovid Goyal (kovid) wrote :

Have you hand edited that file? There is a newline in the second line
which should not be there. Change the contents of the file to be

([a-z|éèàù,:]) <br>
([a-z|éèàù,:])\n \1 \2

<a id="p\d+"></a>

and you should be fine.

Changed in calibre:
status: Incomplete → Invalid
Marc Burger (71marcjacques) wrote :

As far as I can remember, I didn't edit and change the file. I'm trying your solution and hope it solved the problem.

Marc Burger (71marcjacques) wrote :

In fact the first line contain the character CR/LF copied from the pre-processed test.

If I remove it, it works to save and load, but it doesn't match the search.

So, the best way is to insert an ASCII character or \n ?

([a-z|éèàù,:]) <br>
([a-z|éèàù,:])
\1 \2

Kovid Goyal (kovid) wrote :

If you want to match endlines you can use \s but also prefix the regex
with the lags for multiline mode.

Marc Burger (71marcjacques) wrote :

Thank you.

It works by changing CR/LF with \n.

May be it could be useful to add an warning in case the research containing wrong characters ?

The bug may be closed.

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

Other bug subscribers