Quote:
Originally Posted by txckie
I am using this regex at the moment:
" ^(?P<author>((?!\s-\s).)+)\s-\s(?  ?:\[\s*)?(?P<series>.+)\s(?P<series_index>[\d\.]+)(?:\s*\])?\s-\s)?(?P<title>[^(]+)(?:\(.*\))? "
I now need to add publisher to my regex. My books are in this format
Author - [Series Series Index] - Title [Publisher](epub).epub
Example:
JR Ward - [Black Dagger Brotherhood 03] - Lover Awakened [Signet] (epub).epub
Any help would be appreciated.
|
What are you looking for - a regex that captures the exact book filename format above, a regex that captures many variations of that format or a regex that captures many variations of book filenames based specifically on your regex above? Part of what is confusing is that you are using a lot of non-capturing parentheticals and it's not clear why. You don't usually need to use non-capturing parentheticals. Calibre wil ignore any matches not inside the labeled parentheses. You are also using many "?" specifiers for optional matching - again it's not clear why unless you post some of the variations you need to match.
You can try just dropping \s\[(?P<publisher>.*+\]\s in after your title.