Had a very quick play with this, and, it works... with a few 'buts'...
I had to wrap your expression in two expressions... ListClean, removing duplicates still left some trailing semi colons, so, I tested for that, removing if necessary, resulting in quite a cumbersom expression, that nonetheless, worked...
if(isequal(Right(ListClean(Replace(ListMix(/#if(Compare(find([L1],!People\),>=,0),Replace([L1],!People\,),)#/, 0, [keywords]),; ;,;),1),1),/;),removeright(ListClean(Replace(ListMix(/#if(Compare(find([L1],!People\),>=,0),Replace([L1],!People\,),)#/, 0, [keywords]),; ;,;),1),1),ListClean(Replace(ListMix(/#if(Compare(find([L1],!People\),>=,0),Replace([L1],!People\,),)#/, 0, [keywords]),; ;,;),1))
I think there's a bug in the the ListMix function because, if there are brackets in the list items, a syntax error is produced, only for that item, the rest are processed correctly. For example...
After running through the expression above, this keywords string:
!Events\!Concerts\Take That (Caroline & Vada); !People\Family\Caroline; !People\Family\Vada; !Places\!Glasgow\The Hydro
Returns:
Expression Error (Syntax Error); Family\Caroline; Family\Vada
I won't be able to test this against Theater View performance on the HTPC until at least Sunday. Thanks for your help with this zybex.
Do you really think the regex "-2" mode will catch these? How would you get it to to place all the "People" list items into separate captures? My understanding was, that once it dealt with the first instance, it would consider its work done, and stop.
-marko.