The example code for $rsearch is a bit misleading

Hi all,

I spent a while scratching my head reading the text in $rsearch trying to work out the examples. So many solidi :slight_smile:

Anyway, the second example is a bit misleading as it doesn’t actually contain a matching group at all, insofar as there are no grouping parentheses. It seems that a group isn’t required for this function to work.

I think the examples could also be simpler while referring the reader to the rules on escaping.

As a side note, I used the function to create artistsort tags (albeit crudely):

$set(_surname,$rsearch(%artist%,.* \(.*\)))
$set(_name,$rsearch(%artist%,\(.*\) ))
$if(%artistsort%,,$if($ne(%_surname%,%_name%),$set(artistsort,%_surname%\, %_name%),$set(artistsort,%artist%)))
3 Likes

Yeah, I agree that it isn’t the clearest explanation. Do you have any suggestions for a replacement explanation and examples? I’ve created an issue ticket for this to capture any other comments or suggestions, and to make sure that it won’t be forgotten.

1 Like