Importing Ebooks, regexp confusion
Hi all,
I'm trying to import fields from formated files to import to calibre.
here is the regexp I'm trying to make work :
((?P<series>.+) # (?P<series_index>.+) - |)(?P<title>.+)( \[(?P<author>.+)\]|)
If it belong to a series, then my filename will start by :
- "**Serie name** # **Serie number ** - "
There might not be a serie name, so after this, comes the title :
- **title**
And afterwards, I add authors, but not always :
- "[**author**]"
Here is a sample of one of the titles I'm willing to parse :
Serie Name # 01 - Title name [author1 & Author2].epub
This Works : ((?P<series>.+) # (?P<series_index>.+) - |)(?P<title>.+)
This Works if there is a title : (?P<title>.+) \[(?P<author>.+)\]
But this : ((?P<series>.+) # (?P<series_index>.+) - |)(?P<title>.+)( \[(?P<author>.+)\]|)
Always gives up the following error : Attribute editor :'Nonetype' object has no attribute replace
Can anyone help ?
Regards
|