#1 2024-01-30 19:02

Lauraq
Member
Registered: 2016-10-02
Posts: 79

Capitalize every word in brackets (...)

Hi smile

Could you tell me how to capitalize all the words inside the brackets?
And then, if it's not too difficult, if it were possible to lowercase the word "and" and "feat" always inside the brackets

for example

15 - Madonna - Like a virgin _ hollywood (feat christina aguilera and britney spears)

to

15 - Madonna - Like a virgin _ hollywood (feat Christina Aguilera and Britney Spears)

Thank you so much smile

Last edited by Lauraq (2024-01-30 19:05)

Offline

#2 2024-02-06 18:54

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,379

Re: Capitalize every word in brackets (...)

You can use this script in the Pascal Script rule to capitalize all words inside of round brackets:

var
  I, NumMatches, MatchLength: Integer;
  Positions: TIntegerArray;
  Matches: TWideStringArray;
begin
  NumMatches := FindRegEx(FileName, '\(.*?\)', False, Positions, Matches);
  for I := NumMatches-1 downto 0 do
  begin
    Delete(FileName, Positions[I], Length(Matches[I]));
    Insert(WideCaseCapitalize(Matches[I]), FileName, Positions[I]);
  end;
end.

Then, you can use the Case rule to lower case the desired words like "and" and "feat" via the force case option.

We also plan to add a more general mechanism that will allow users to apply renaming rules to a selected part only.

Offline

#3 2024-02-06 22:42

Lauraq
Member
Registered: 2016-10-02
Posts: 79

Re: Capitalize every word in brackets (...)

fantastic, thanks smile

Offline

Board footer

Powered by FluxBB