Quote:
Originally Posted by MSWallack
Interesting. OK. So what do I add (and where do I add it) to note that the filename may or may not include a series? There won't be any brackets unless they are used to designate a series.
|
I think I already answered that:
Quote:
Post an example filename. The simplest is to add a parenthetical around your optional part and stick a "?" after it (no quotes).
|
That's the short answer. The longer answer is that this will often break something. A quick example is that suppose you sometimes don't separate author and title with space-hyphen-space. You can't just make it optional or it will be unable to find the split between author and title. In your case, use the brackets to find the series, then make it optional. Beware that you said you sometimes have brackets around the filetype after the title, which might screw things up.
There is no "magic" regex that fits everyone/everything.
BTW, brackets are special, so you need to "escape" them with a backslash. This is a bracket: "\["
This means match the letter "a" or "b": "[ab]
This means match an open bracket or the letter "a": "[\[a]