View Single Post
Old 09-18-2011, 09:44 AM   #253
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,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by kacir View Post
I think that Regular Expression you use as example for adding books is not optimal, because the series info isn't optional, so it wouldn't work for majority books that don't have format author - series # - title. For example author - title wouldn't be processed.
I know nothing about regex, but I tested his regex with this book:

Alan Jacobson - The 7th Victim.epub

and it filled in the proper title and author. This test says you may be incorrect in what you said above.

Personally I use the following pilfered regex (in various formats):
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; 09-18-2011 at 09:47 AM.
DoctorOhh is offline