HydrogenAudio

Hosted Forums => foobar2000 => 3rd Party Plugins - (fb2k) => Topic started by: EagleScout1998 on 2021-04-25 03:21:07

Title: Another masstagger script issue.
Post by: EagleScout1998 on 2021-04-25 03:21:07
I have been using Masstagger as a means to enforce case rules. But I have run into a small issue. Suppose I want to ensure that “CIA” is capitalized. I would use the pattern $replace(%title%,Cia,CIA). However, this also affects any other words(s) that start with those same letters. I’m wondering if there is a way to keep that from happening. Otherwise, I would have to use another pattern to reverse the action, e.g., $replace(%title%CIAo,Ciao). Is there some workaround that I haven’t discovered yet?

Hope y’all can understand what I’m trying to say.
Title: Re: Another masstagger script issue.
Post by: jazzthieve on 2021-04-25 05:03:55
Going off your example I'm guessing CIA is a singular word? In that case to avoid changing case of other words which have the same letters in it simply add a space character in your replace function.

Code: [Select]
$replace(%title%,Cia ,CIA , Cia , CIA )

One with a space trailing for when Cia is the start of a sentence and one with a space character before and after for when it's in the middle of a sentence. Like this words like "appreciation" will not get altered.