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!!
|