Quote:
Originally Posted by kacir
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]+)