View Single Post
Old 10-25-2014, 04:25 AM   #2
kite
enturbulated
kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.kite can tell if an avocado is ripe without touching it.
 
kite's Avatar
 
Posts: 30
Karma: 130494
Join Date: May 2007
Device: Kobo Aura HD
I can't tell you if there is one regex that will do all your filenames.
I know far too little.
If you want to start adding some anyway then ...
Quote:
Doyle, Arthur Conan - Adventures of Sherlock Holmes, The.txt


Lewis, C.S - The Chronicles of Narnia 2 - The Lion, the Witch and the Wardrobe.txt

This regex from kiwidude works on both of the above two filenames.
Code:
^(?P<author>((?!\s-\s).)+)\s-\s(?:(?:\[\s*)?(?P<series>.+)\s(?P<series_index>[\d\.]+)(?:\s*\])?\s-\s)?(?P<title>[^(]+)(?:\(.*\))?
works with;
Bloggs, Joe - My title
Bloggs, Joe - Some Series 1 - My title.txt
Bloggs, Joe - Some Series 1.5 - My title.txt
Bloggs, Joe - Some Series 1.5 - My title with sub-title hyphen.txt




Quote:
Grimms Fairy Tales - Adventures of Aladdin.txt
Is this
Series - Title
If so the regex below works when I test it.
(?P<series>[^_]*) - (?P<title>.+)
kite is offline   Reply With Quote