problem with captured group replacement in search/replace

Bug #1903987 reported by capink
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

using calibre 5.4.1 I tried the following search/replace

search field: title
search for: (.*)
replace with: \1 _ append to title
search mode: regular expression
mode: replace field

the result for the above search is as follows:

title: a > title: a _append to title _ append to title

When I tried the same search/replace in calibre 4.23 it gave me the expected result:
title: a > title: a _append to title

I attached a screenshot to demonstrate the error.

Revision history for this message
capink (capink-eg) wrote :
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1903987

yes the behavior of .* is different in python 2 and 3. Use .+ instead.

 status invalid

Changed in calibre:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.