View Single Post
Old 10-25-2014, 06:00 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
Quote:
Originally Posted by arberg View Post
...

Code:
^(?P<author>[^-]+)(\s*-\s*(\[?(?P<series>[^-0-9]+)\s*(?P<series_index>[0-9.]+)?]?)?)?.*?-\s*(?P<title>[^\]{[()]+\w)
The expression expects the filename to start with Author and end with Title (possibly followed by garbage in parentheses). It also optionally matches series, and series index in the middle. It requires the title to end in an alpha-numeric character, and it does not allow the title to contain any kinds of parentheses (anything following a parenthesis will be discarded)

It matches the following examples filenames
Author Harris - Kingdom come
Author Harris - Kingdom come (v1.0)
Author Harris - Kingdom series - The Very Magical Kingdom (v1.0)
Author Harris - Kingdom series 14.5 - The Very Magical Kingdom (v1.0)
Author Harris - [Kingdom series 14.5] - The Very Magical Kingdom (v1.0)
Author Harris - [Kingdom series 14.5] [another useless string]- The Very Magical Kingdom (v1.0)

Author: Author Harris
Title: Kingdom come
Series: Kingdom series
Series Index: 14.5
(from https://www.mobileread.com/forums/showthread.php?t=88896)

Last edited by kite; 10-25-2014 at 06:03 AM. Reason: add CODE /CODE
kite is offline   Reply With Quote