Remove middle part in brackets from title

Hi, this is my first post so please understand if I don't get it right.
My problem:

In some files the TITLE is too long and I want to remove part of it. I understand how to remove a part from the beginning or the end, but how to remove something from the middle?
For instance (this is a fictive example)

Mozart - Pianoconcerto Nr. 25 (revised by Salieri) in E major, part 1 allegretto

I want to remove
(revised by Salieri)
in each of the tile tags.

Try an action of the type "Replace with regular expression"
Search string: \(.*\)
Replace string:
(leave empty)
Please note that there is a space as last character in the search string.

1 Like

Thank you for your reply, but since I am bit of a beginner in mp3tag I I really don't know how and where to use this.
Can you be a bit more specific please?

So it would be nice if you could have a look at the FAQs first.


And where do you think was my answer lacking the specific information?

I already searched a lot, but did not find an exact instruction so far, hence my post.
I will search your suggestions too, thanks. I need to know, for a beginner, in which box to put which command.

For instance, to remove the first n characters from a title I found this very helpful command with an explanation where to put it (tag to tag):

TITLE <== $cutLeft(%TITLE%,n)

I am looking for something similar for my question.

If you want to use Convert>Tag-Tag for TITLE, try
Format string: $regexp(%title%,\(.*\) ,)

Sorry, but I still don't quite understand.
When I put this in tag to tag nothing changes, but I presume I need to puit something between the brackets?
Don't understand what all this stands for: \(.*\) ,)

What would that be?
As Convert>Tag-Tag has a preview, you should see the immediate result, here: the string without that part in the brackets.
Also, as you can see the input field in the dialogue is labelled "Format string".
You copy and paste the string that I suggested into that field.

Now, a regular expression leads to no result (here: the string stays as it is) if the pattern does not match. So instead of giving

it would be better so see a real life string.

To see more about regular expressions, see the help:
https://help.mp3tag.de/options_format.html#regexp

There is, of course, the way to replace a string constant with nothing, e.g. with an action of the type "Replace" for TITLE
Search string: (revised by Salieri)
Replace string:
(leave empty)
This works only for this exact string. if you have versions with "(revised by Clementi)" then it would not work - the regular expression would cater for both cases.

Thank you for your patience. Although I am an experienced above average computer user I know nothing about scripting. I still cannot make sense of it, I am too stupid for this and need an explanation for a 3-year old.
I go to Conversion Tag-Tag
In the dialogue box upper line I see TITLE
In the second line I put $regexp(%title%,\(.*\) ,)

But in the preview of the title underneath nothing changes. I guess I nee to put "revised by Salieri" somewhere in the second line?

1 Like

As I said: the target string looks like the original string if the pattern cannot find a match in the original string.
If you want to go withoug pattern but with a string constant, then use the second option: a simple replace.
Or, and this has been suggested also already:

A string like
"Mozart - Pianoconcerto Nr. 25(revised by Salieri)in E major, part 1 allegretto"
would not match.
Or any other string where you don't find the pattern "opening bracket, any text, closing bracket, space"

Real life string, in another CD:

Orchestral Suite No. 2 in B minor, BWV 1067: Movement 4: Bourrée I / Bourrée

It is too long and contains double information, so I want it to look like this:

Orchestral Suite No. 2: Movement 4: Bourrée I / Bourrée

$regexp(%title%, in .*?\d+,$1)
-> "Orchestral Suite No. 2: Movement 4: Bourrée I / Bourrée"

So, with which real life string did you test the pattern that has the deletable string in brackets?

I finally found the solution in alt-6, replace. It takes a bit more time because the part I want to replace it not the same everywhere, to give position numbers in the string would be easier, but it works. Thanks for all your trouble.

This is most likely not true if you have varying strings.
In the examples that you provided, the first string started at position 28 and in the second in position 23 ...
Anyway, you ware free to experiment and you may like to have look at the scripting functions esp. for strings.
See the help:
https://help.mp3tag.de/main_scripting.html#string
perhaps with a close look at $left(), $right(), $mid()

Thanks again. I will find my way eventually as I have in the past for other things. The last link is very helpful.
The string part I want to remove is usually the same number of characters, but the characters are different.

Perhaps this is sobering:
"in B minor, BWV 1067:" = 21 characters,
" (revised by Salieri)" = 20 characters.
Still I don't get it how you want to cut a certain number of characters from a string if you don't know where to start ...

They are two different examples.
One of the real things is the Bach one, but with different BWV numbers and different key, but the string length is the same.

And this is taken care of with the regular expression: the pattern ist: take everything starting with "in" and ends with the first number.