
Hey guys,
I'm trying to edit some bulk data using regex and I'm having trouble matching groups. I wasn't paying attention when importing, so now I have author fields that can include author, author and series, or author, series, and series number.
I'm trying to match series and seriesnum out of the author field and send them to the appropriate places using the bulk meta edit tool. the expression I'm using right now is:
([a-zA-Z.\ ]+) (\-) ([\ \w]*) (\d+)
which matches "A. J. Author - Series of Books 01"
I can then use \3 to send "Series of Books" to series and \4 to send "01" to seriesnum.
The problem is when it finds an author field with just an author and no series number or series (i.e. "A. J. Author"). In that case \3 and \4 also match "A.J. Author" though it seems they should be blank instead since they shouldn't exist.
Can anyone help me figure this out?