Getting rid of pauses - in brackets

I have this code

Format value: $trim($replace(%TITLE%,' ',''))which removes all pause from my TITLE tag

How it should be modified so that it would only removes pauses that happen to be inside brackets? When there could be unspecified and unpredictable number of also other signs than pauses?

So in other words, how to turn for example:

Title Of A Song [ b]
(Sub-Title Of A Song) [m 2  ]
{2005 Mix} [  m4- 5 e]into:
Title Of A Song [b]
(Sub-Title Of A Song) [m2]
{2005 Mix} [m4-5e]
QUOTE (zerow @ May 12 2016, 20:26) <{POST_SNAPBACK}>
I have this code
Format value: $trim($replace(%TITLE%,' ',''))which removes all pause from my TITLE tag

How it should be modified so that it would only removes pauses that happen to be inside brackets? When there could be unspecified and unpredictable number of also other signs than pauses?

So in other words, how to turn for example:

Title Of A Song [ b]
(Sub-Title Of A Song) [m 2  ]
{2005 Mix} [  m4- 5 e]into:
Title Of A Song [b]
(Sub-Title Of A Song) [m2]
{2005 Mix} [m4-5e]<!--QuoteEnd--></div><!--QuoteEEnd-->

A simple replace of a double-blank into a single blank should remove the unpredictable number of space characters.

Then, I guess, you would have to create an action for each leading and each trailing type of bracket to replace a bracket-blank or blank-bracket with just the bracket.

Remove space characters within a square bracket clamp, which is part of the TITLE string ...

TEMP <== $regexp(%TITLE%,'^(.*?)(\[.*?\])(.*?)$','$2') TEMP <== $regexp(%TEMP%,'\s+',) TITLE <== $regexp(%TITLE%,'^(.*?)(\[.*?\])(.*?)$','$1'%TEMP%'$3') TEMP <== $char(0)

DD.20160514.1055.CEST

Such a set of format values works

But only for the first brackets. If there is for example something like

Title Of A Song A [ m e ] + Title Of A Song B [ b m ]it will get turned into
Title Of A Song A [me] + Title Of A Song B [ b m ]instead of
Title Of A Song A [me] + Title Of A Song B [bm]

I would say: GIGO - Garbage in, garbage out.
You only mentioned one pair of brackets in your examples.
Doesn't a second run of the action rectify the problem?

(And: what about a "Thank you, DetlevD, I forgot to mention that there are some files that have more than one pair of brackets. Could you help me with that as well?")

No it does not

That was my first thought; because I periodically run my big cleaning action group because some work can't be [or I prefer it not to be] done with a single click

Thank you, DetlevD, I forgot to mention that there are some files that have more than one pair of brackets. Could you help me with that as well?