View Single Post
Old 10-17-2011, 12:57 AM   #7
Jade Aislin
Groupie
Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.Jade Aislin could sell banana peel slippers to a Deveel.
 
Posts: 164
Karma: 3100
Join Date: Sep 2011
Device: Kobo Auro H2O, PRS-T1
Talking

Quote:
Originally Posted by chaley View Post
To repeat, you want to match some genre names no matter where they appear in the hierarchy, beginning, middle, or end. For those that match, print the last item in the hierarchy, which might be the matched item. The following does that for comics and history.
Code:
{#genre:'subitems(list_re($, ',', '(\.|^)(comics|history)\.', ''), -1, 0)'||}
The change was to not anchor (in the regular expression sense) the match to the first item, which is what I thought you wanted. Instead, the new regexp matches 'comics' or 'history' between dots (an internal item), between the beginning and a dot (the first item), between a dot and the end (the last item), or between the beginning and the end (the only item).

The reason to add the || at the end is to keep the template parser from being confused by the | characters in the regular expression.
That is exactly what I wanted. I plugged in my own items and it worked beautifully. Thank you.

Now all I need to do is input the information into the custom column. With too many stories to count, it may take some time. At least I can look forward to having a library where I can find a story I'm in the mood for.

- Jade Aislin
Jade Aislin is offline   Reply With Quote