I'm trying to use the tags that get automatically imported to build my #genre column based on other columns (tags). It's slow going, but with over 8000 books and over a couple of dozen new ones added each week, worth it to figure out. But I'm stuck on a couple of things. First is a regex question at the bottom. Second, is there a known/better way for setting up a #genre column already? There was a plugin (DeriveGenre) that's no longer up.
So my custom column is set up like this right now:
Code:
program:
build_genre = list_re_group(field('tag'), ', ', '', '(.*)romance(.*)', '', 'Love & Romance ', '');
build_genre = list_re_group(build_genre, ', ', '', '(.*)fantasy(.*)', '', 'Fantasy ', '');
build_genre = list_re_group(build_genre, ', ', '', '(.*)crime(.*)|(.*)mystery(.*)', '', 'Crime & Mystery ', '')
One of my tags is "Private Investigators (1+)" so I
I tried in
build_genre = list_re_group(build_genre, ', ', '', '(.*)investigat(.*)', '', 'Crime & Mystery ', '')
but it doesn't like that. When I switched it to
build_genre = list_re_group(build_genre, ', ', '', '(.*)privat(.*)', '', 'Crime & Mystery ', '') it did take it. I tried '^(.*)investigat(.*)' and a couple of other things but still not getting it.
Thank you in advanced!