Help understanding $rsearch()

Ah, you’re right. It was late when I made the post and I must have been tired, it seems so obvious now. In the meantime I solved it myself by adding the $not() function between the $if and $rsearch statements. I also improved the regex a little bit like this:

$if($not($rsearch(%artist%,\\A[Tt][Hh][Ee] |\\A[Aa] |\\A[Aa][Nn] ),$delete(artistsort))
The \A matches string at the beginning of the artist name, so it won’t sort an artist with ‘the’ in the middle of their name.

I’m working on a more complex version of the script that also matches classical music and a few other exceptions to include the artistsort tag. This is more my personal preference but I wonder if it’d be useful to others.

1 Like