View Single Post
Old 12-05-2015, 01:20 PM   #1
jrkotrla
Junior Member
jrkotrla began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Mar 2009
Device: Sony PRS-500, Treo 755p, REB 1100, eBookman 911
Question Bulk Meta Edit (regex troubles)

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?
jrkotrla is offline   Reply With Quote