Mobileread
Reg expression for importing
#1  Debby 02-16-2011, 09:39 PM
I have been working on importing files that are in the following format:

Ark Angel (Alex Rider 6) - Anthony Horowitz.lrf

Using:

(?P<title>([^\-_\[\(]+))(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)(?P<author>([^_\[\(]+))

I am getting really close!

Title: Ark Angel
Author: ) - Anthony Horowitz
Series: (Alex Rider
Series Index: 6.0

I have tried playing with the looking at other examples, the tutorial and playing with the spaces, but I only make it worse! Any advice would be appreciated.

Thanks.
Reply 

#2  Perkin 02-17-2011, 04:11 AM
Try

(?P<title>.+) \((?P<series>[^_0-9-]*) (?P<series_index>[0-9]*)\) - (?P<author>.+)
Reply 

#3  Debby 02-17-2011, 11:20 AM
This is perfect! I appreciate the help!
Reply 

Today's Posts | Search this Thread | Login | Register