Help with removing certain characters from a string of a user-defined tool

I’m using this string https://rateyourmusic.com/song/$replace($lower(%artist%)/$lower(%title%), ,-) to check RYM for data on specific songs, but since special characters (‘, &,…) invalidate the search I’m looking for a way to automatically remove them from the link.

For example if I search for a song instead of giving me this https://rateyourmusic.com/song/sly-&-the-family-stone/que-sera,-sera-(whatever-will-be,-will-be)/

i want it to give me this https://rateyourmusic.com/song/sly-and-the-family-stone/que-sera-sera-whatever-will-be-will-be/

If anyone has an idea of how to achieve this, the help would be greatly appreciated

From the documentation:

$replace(x,y,z)

  • returns the string x with all occurrences of string y replaced by string z. Supports multiple parameter pairs y and z.

The "multiple pairs" part means that this function actually behaves more like $replace(x,y1,z1,y2,z2,...,yN,zN), and can be used to replace several characters\strings in one go.

You can remove your undesired characters (‘, &,…) with
$replace(%string%,',,&,,...,[unwanted character A],[blank],[unwanted character B],[blank])

Hope this helps.

It does help, but I’m running into the issue that if I try to replace any special character’s with nothing it deletes everything that follows.

To stick to the same example using this https://rateyourmusic.com/song/$replace($lower(%artist%)/$lower(%title%), ,-,&,and,',', ,'(', ,')', )

will give me this https://rateyourmusic.com/song/sly-and-the-family-stone/que-sera/

Do you have an idea on what might be the issue

Are you sure @chero97?

Could you please show us exactly what you currently use as ARTIST and TITLE content?

If I try it with:
TITLE: Que Sera Sera (Whatever Will Be, Will Be) (alternate mix)
ARTIST: Sly & the Family Stone
and your
$replace($lower(%artist%)/$lower(%title%), ,-,&,and,',', ,'(', ,')', )
I see this preview result:

%artist% is Sly & The Family Stone

%title% is Que Sera, Sera (Whatever Will Be, Will Be)

figured it out $replace($lower(%artist%)/$lower(%title%), ,-,&,and,',',,'(',,')',)

Thanks for the help

Still doesn’t seem to work for apostrophe’s though

Example for ARTIST or TITLE with apostrophes that doesn't work?

Figured it out, needed to look like this in the string $replace($lower(%artist%)/$lower(%title%), ,-,&,and,',',,'(',,')',,‘‘,,)

For anyone interested in the final string

https://rateyourmusic.com/song/$replace($lower(%artist%)/$lower(%title%), ,-,&,and,'(',,')',,',',,'',,'-(feat.', ,à,a,à,a,ä,a,ã,a,å,a,â,a,ć,c,č,c,ċ,c,ç,c,ĉ,c,ð,d,ē,e,ě,e,ĕ,e,é,e,ê,e,ė,e,è,e,ë,e,ę,e,ī,i,ǐ,i,ĭ,i,í,i,î,i,ĩ,i,ì,i,ï,i,ñ,n,ń,n,ņ,n,ň,n,ṅ,n,ō,o,ǒ,o,ó,o,ô,o,ò,o,ö,o,ŏ,o,ø,o,õ,o,ŕ,r,ř,r,ū,u,ǔ,u,ŭ,u,ú,u,û,u,ũ,u,ù,u,ü,u,ý,y)

Adjusted it after some testing against my music library

https://rateyourmusic.com/song/$replace($lower(%artist%)/$lower(%title%), ,-,&,and,'-(feat.', ,.,,+-,,'(',,')',,',',,'',,!,,à,a,ä,a,å,a,â,a,ç,c,ð,d,é,e,ê,e,ė,e,è,e,ë,e,í,i,ì,i,ï,i,ñ,n,ó,o,ò,o,ö,o,ø,o,ü,u,ú,u,ù,u)

feat. removal needs to go before the () removal as to not interfere with eachother and the function seems to have a maximum amount of variables it’s able to remove so I removed some of the rare letters

Also there are some idiosyncracies in how rym links are constructed in which this will still not produce results. Namely if there are abbreviations separated by dots in the title or artist because those would need to be replaced by underscores, while any other instance of a dot in an artist name or song title needs to be removed for the link to work