Quote:
Originally Posted by tweebee
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.