Capitalize the first letter of certain words

I know it’s against MusicBrainz convention but I prefer to have words like “remix” and and “skit” to have the first letter capitalized, as in “Remix” and “Skit”, respectively.

How do I accomplish this with the $rreplace function (or whichever appropriate function)? I can’t seem to get it right.

Thank you!!

Do I understand correctly - you want to capitalize words like remix and skit?

We don’t need $rrplace - better change (capitalise) each word separate with $replace:

$if($rsearch(%title%,remix),$set(title,$replace(%title%,remix,Remix)))
$if($rsearch(%title%,skit),$set(title,$replace(%title%,skit,Skit)))

These should be separate statements in case both words appear in one ETI. I’ve first tried with a if not condition, but if the first word matches, the second one would not be replaced.

EDIT: $if is not necessary - if “remix” is not found, the title remains unchanged.

$set(title,$replace(%title%,remix,Remix))
$set(title,$replace(%title%,skit,Skit))

EDIT2: I think, searching for “skit” is risky - you will not search in English titles only and even those could contain names with “skit” in the middle (certainly not to be capitalized)

For “skit” I would recommend:

$if($rsearch(%title%,[^:alpha:]skit),$set(title,$replace(%title%,skit,Skit)))

If there’s a alphabetic character preceding “skit” - no capitalization

1 Like