Quote:
Originally Posted by Spiffy
Your standard naming includes no brackets, right?
|
I started to respond to this twice, but I'm not at home and can't test anything I post. It's pretty easy to make the brackets optional if everything else is right.
this is an optional open bracket:
\[?
and this is an optional closed bracket:
\]?
Try this (totally untested):
Code:
wrong code posted (untested)
no, try this (tested):
Code:
^((?P<author>([^\-_0-9]+)(?=\s*-\s*)(?!\s*-\s*[0-9.]+)|\b))(\s*-\s*)?(\[?(?P<series>[^0-9\-]+) (- )?(?P<series_index>[0-9.]+)\]?\s*-\s*)?(?P<title>.+)