View Single Post
Old 08-04-2011, 11:11 AM   #2
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 tweebee View Post
IThey are in this format:

ISBN_Title_[Publisher].ext

I would like to parse the ISBN, Title, and Publisher into their appropriate fields while ignoring the underscores and brackets.
Try this:
Code:
(?P<isbn>.*?)[_ ](?P<title>.*)[_ ]\[(?P<publisher>.*)\]
Underscores are treated specially and are converted to spaces, so they tend to disappear automatically. I made the regex a bit less dense so you can see what it's doing.
Starson17 is offline   Reply With Quote