![]() |
#1 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2011
Device: Calibre
|
Help in adding books using "regular expression"
Hi all,
I've been trying to add books with this naming format; [Author - Series - Title] "Arthur C. Clarke - Time Odyssey 1 - Times Eye" so I used this in the expression and it worked (?P<author>.+) - (?P<series>[^_]+) - (?P<title>[^_]+) but when I get a different book name like; [Author - Title] it gets messed up "Arthur C. Clarke - Cradle" I need a good expression to use with both [Author - Series - Title] and [Author - Title] to get the author, the series and the title in their right places. Thanks in advance ![]() ![]() ![]() |
![]() |
![]() |
![]() |
#2 |
US Navy, Retired
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
|
I didn't write this but it should meet your needs.
Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?((?P<series>[^0-9\-]+)(\s*-\s*)?(?P<series_index>[0-9.]+)\s*-\s*)?(?P<title>[^\-_0-9]+) Last edited by DoctorOhh; 07-08-2011 at 06:36 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Junior Member
![]() Posts: 4
Karma: 10
Join Date: May 2011
Device: Calibre
|
Wow Thanks man
![]() Thank you so much |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding Books, regular expression | smarties86 | Calibre | 4 | 12-19-2010 08:18 AM |
Regular Expression on adding books. | Lokro | Calibre | 4 | 11-06-2010 11:05 AM |
Need Help With "Regular Expression Syntax" | dkritso109 | Calibre | 42 | 10-05-2010 09:03 AM |
Regular Expression For Adding Books | jhart711 | Calibre | 3 | 09-27-2010 06:51 AM |
Help: Is there a search expression for "books without Series"? | LARdT | Calibre | 3 | 01-20-2010 09:34 PM |