![]() |
#1 |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Aug 2018
Device: paperwhite
|
Move date from beginning to end of title w/ regex?
Hi, I have several titles that include a date at the beginning of the title that I'd like to move to the end. So...
2018-07-01 The Title to The Title 2018-07-01 All dates are in this format. Seems like this should be relatively straightforward using Bulk Edit Metadata, but I can't wrap my head around how to make it happen. Last edited by melba.d; 08-03-2018 at 02:01 AM. Reason: clarification |
![]() |
![]() |
![]() |
#2 |
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
|
You should be able to get away with:
Search for: (.*?)\s(.*) Replace with: \2 \1 But, if you accidentally select a title that doesn't have the date, you will mess it up. So, safer is: Search for: ([\d-]+)\w(.*) Replace with: \2 \1 That looks like it won't mess with titles that don't have the date at the start. Unless you have something like "101 Ways to Write Regex in calibre". And use title for both the Search and destination fields. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Junior Member
![]() Posts: 2
Karma: 10
Join Date: Aug 2018
Device: paperwhite
|
Quote:
Ohhhh, I see what I did wrong. I tried to match just the date but then couldn't figure out what to put in the replace field to make it work. Now I see you need to match both parts and then switch them. Thank you, this was so helpful and now I understand regex slightly better! |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
RegEx-Putting pub. date after first sentence in title if two or more sentenced title | font332 | Library Management | 0 | 08-17-2017 08:49 AM |
Sorting: Same title beginning, shorter title first | Under the Covers | Calibre | 14 | 05-04-2015 10:18 PM |
Regex to search at beginning of line | kakkalla | Sigil | 30 | 06-03-2013 03:08 PM |
How to move toc go the beginning of epub file | IanSR | ePub | 15 | 05-04-2013 09:22 PM |
Bulk move 'The' and 'A' to end of Title | macnab69 | Library Management | 3 | 01-28-2013 09:26 AM |