Thread: Adding Books
View Single Post
Old 04-11-2011, 12:28 PM   #3
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by cityzen View Post
Hi All
I am adding some books and the titles have all the details and have the same format. I have been playing with the regex stuff, but can seem to get more than a couple of the details at a time.

Titles look like this:
002 - Foundation Series - [The First Trilogy] - Second Foundation (by Isaac Asimov).epub

what is the regex to break this all apart to get the following results:
Title: Second Foundation
Authors: Isaac Asimov
Series: Foundation Series - The First Trilogy
Series Index: 002

Thanks in Advance
CZ
Without removing square brackets:
Code:
(?P<series_index>[0-9]+) -?\s*(?P<series>[^_0-9]*)\s*-\s*(?P<title>[^_].+) ?\(by (?P<author>[^_].+)\) ?
Starson17 is offline   Reply With Quote