View Single Post
Old 01-02-2014, 02:38 PM   #1
pgilbr1
Junior Member
pgilbr1 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Dec 2011
Device: Kindle
Red face How to format regular expression for adding books?

I am needing to create a regular expression to add new books to my library. The books are in Series Series-Index Title - Author format. The expression I am currently using works if all the books have a series, but if it only has the title it does not work.
(?P<series>[^_0-9-]*)(?P<series_index>[0-9.2]*)\s*(?P<title>[^_].+) -?\s(?P<author>[^_-]+)

How do I get the expression to check if the series is part of the book name?
Thanks for any help!!
pgilbr1 is offline   Reply With Quote