|
|||||||
![]() |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,471
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
Possible bug report - Edit metadata in bulk, search and replace series
I have two books.
One with series name "Random text" The other with series name "Something else" I select those books, press E for Edit metadata in bulk. Go to the Search and replace tab Search field: Series Search for: .* Replace With: Word I would expect that it replaces the series with "Word", but it replaces the series with "WordWord". The dot in regular expression represents any character and star is a greedy quantifier - it should match the entire string. When I want to replace the entire string with the "Word" I have to use "Search for" regular expression ^.* with caret anchoring the RE to the beginning of the string Then it works the way I would expect. I tried to use this edit to replace several versions of the series name with a unified name while preserving series numbering and was surprised by this behavior. Am I doing something wrong? Am I overlooking something obvious? I can live with this behavior, but it might indicate that there is something wonky in the way it parses Regular Expressions. I am using Calibre 8.16.1 on Mint Linux 21.3 x86_64 |
|
|
|
|
|
#2 |
|
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,839
Karma: 28586150
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
That's how the regex module in python works. .* will matchthe full string and then the empty string at the end of the full string when not anchored. Either anchor it with ^ or use .+
|
|
|
|
|
|
#3 |
|
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,471
Karma: 10684861
Join Date: May 2006
Device: PocketBook 360, before it was Sony Reader, cassiopeia A-20
|
Thank you for an explanation and the quick reply. And for Calibre, of course.
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bulk Edit Search & Replace expressions? | OldLincoln | Library Management | 6 | 01-14-2017 07:00 PM |
| Bulk Metadata Edit search replace Question | Paltieldav | Library Management | 5 | 03-01-2016 07:12 AM |
| Edit metadata in bulk vs search and replace | inl1ner | Library Management | 6 | 07-14-2014 07:58 PM |
| 2 Questions about Bulk Edit Search & Replace | BookJunkieLI | Library Management | 6 | 02-19-2012 02:39 PM |
| Setting series index in bulk metadata search&replace | bubak | Calibre | 4 | 12-19-2010 05:04 PM |