![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 889
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Regular expression to clean title
Hello people, I have books in which the title appears like this:
The Heart of Darkness [trans. Miguel Early Garcia] I would like to put a regular expression when adding books, that I clean everything that is between the [] or () Could you help me? From already very grateful Last edited by dunhill; 08-06-2020 at 07:53 PM. |
![]() |
![]() |
![]() |
#2 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 889
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Apparently not possible
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
![]() |
![]() |
![]() |
#4 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 889
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
But I have come across some books that have braces or parentheses in the title. Thanks for answering theducks !!! |
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
@dunhill: I did have a quick look at it when you posted. I could see some problems and hoped someone else would come along
![]() The following will handle the case you mentioned: Code:
(?P<title>[^\[\(]+)\s*(\[.*\]|\(.*\))? I think I like @theducks suggestion. The above regex should work with the bulk search&replace. |
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,037
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
\1 is the title \2 is the name (without trans. ) so you could APPEND to {authors}: \2 (trans) As you can see, this is fragile: in that it expects trans.(space) |
|
![]() |
![]() |
![]() |
#7 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 889
Karma: 409970
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Thank you very much.
Ok I'm going to try the alternatives, S / R seems more dynamic to me Theducks and Davifor |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is this possible using a regular expression? | unabatedshagie | Library Management | 2 | 03-17-2016 09:47 AM |
Please help me with regular expression :help: | Tatjana | Library Management | 2 | 05-30-2014 05:41 PM |
Search for a regular expression in title and move it to series | venunayar | Calibre | 0 | 03-27-2013 12:43 PM |
Regular expression for Title sort | kakkalla | Calibre | 8 | 01-19-2011 06:45 PM |
Regular expression help | krendk | Calibre | 4 | 12-04-2010 04:32 PM |