View Single Post
Old 03-04-2015, 11:49 PM   #10
JohnnyBook
Addict
JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.JohnnyBook holds these truths to be self-evident.
 
Posts: 203
Karma: 126824
Join Date: Dec 2008
Location: Out There
Device: K3 W/3G (Fixed screen!) & Paperwhite Wifi
Quote:
Originally Posted by eschwartz View Post
Yes, append that group with a question mark.
Code:
(?P<series>[A-Za-z ]+)-(?P<series_index>[0-9]+) (?P<title>.+) \((?P<author>[A-Za-z. ]+)\) (?P<published>[0-9]+)?
If I had known the published date was supposed to be optional, I would've done that in the first place. You get what you asked for.

First line in my OP.

"90% of my files are in the format: (The other 10% do not include the pub date)"

In any case, Thanks bunches for all your help.

EDIT: Nope still did not do it... Maybe since it does not find the space after the Author, it still fails?

ROT-4089 Make it this way (Jane Smith) 2009.txt
ROT-4089 Make it this way (Jane Smith).txt

The first works, the second is not parsed.

Last edited by JohnnyBook; 03-05-2015 at 12:01 AM.
JohnnyBook is offline   Reply With Quote