Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-08-2011, 05:41 AM   #1
DM399
Junior Member
DM399 began at the beginning.
 
DM399's Avatar
 
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



DM399 is offline   Reply With Quote
Old 07-08-2011, 06:32 AM   #2
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,834
Karma: 13774200
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
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.
DoctorOhh is offline   Reply With Quote
Advert
Old 07-08-2011, 06:38 AM   #3
DM399
Junior Member
DM399 began at the beginning.
 
DM399's Avatar
 
Posts: 4
Karma: 10
Join Date: May 2011
Device: Calibre
Wow Thanks man that worked like a charm!!!
Thank you so much
DM399 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:06 AM.


MobileRead.com is a privately owned, operated and funded community.