View Single Post
Old 09-27-2011, 10:35 AM   #2
ZaMotH
Junior Member
ZaMotH began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Sep 2011
Device: IQ pocketbook
tried some more ...

I tired again and got some good things ... withou the author

Here are all my possible filename list :
1) Series # 00.zip
2) Series # 00 - Title.zip
3) Series # 00 - Title [author].zip
4) Series # 00 [Author].zip
5) Title.zip
6) Title [Author].zip

Without the author, I found out that this would work perfectly for 1, 2 and 5
(?P<series>.+) # (?P<series_index>\d+)( - (?P<title>.+)|)

For case 1, series and series_index are filled, AND title = Series # 00
For case 2, series, index and title are filled
For case 3 title is filled


But everytime I try to add the " [Author]", I get messed up all around.
I know the parsing should go like ( \[(?P<author>.+)\[)
But I can not make it conditional
added a "?" at the end, but after reading some other forums, I do not fully understant the "?" meaning
Tried the trick (( \[(?P<author>.+)\[)|), but that throws me the error "Attribute editor :'Nonetype' object has no attribute replace"

Can anyone help ?
ZaMotH is offline   Reply With Quote