RegEx leaves an extra space

I use this Action to remove everything in brackets in my Tags :

Replace with regular expression
_All
(.*)\(.*\)$
$1

It works well but unfortunately it leaves a space at the end of each action. This must be the space before the phrase in brackets.

For example

songtitle (text).mp3

becomes

songtitle .mp3

Can someone suggest an amendment to the RegEx above to remove the space as well as the expression in brackets that follows it?

So that

songtitle (text).mp3

becomes

songtitle.mp3

Grateful for any help. :slight_smile:

Try
(.*)\s*\(.*\)
To cater for no to many spaces following the brackets.

Hi

OK thanks for your help.

Unfortunately the space is still there.

I'm trying this -

_All
(.*)\s*\(.*\)$
$1

but it doesn't remove the space. I also tried without the dollar sign in the RegEx code.

Do I have this correct from what you say?

:slight_smile:

Perhaps this is better:
(.*?)\s*\(.*\)$

I would never user _ALL for such an action. Do you really have under controle that you want to delete everything in brackets?
e.g. Icehouse - Cross the Border (Steel Love) [Dance Mix]
Aretha Franklin - Oh My Oh My (I'm a Fool for You Baby);
Don't Play that Song (You Lied);
Border Song (Holy Moses)
Queen - Teo Torriatte (Let Us Cling Together)
and many more at least in my collection.

@chayes
Please, don't use _ALL.
I'm pretty sure you don't want to remove everything in brackets for example in your UNSYNCEDLYRICS or other tags included in _ALL.

Thanks for your help. :slight_smile:

It doesn't have to be _ALL. This is just an example. I can change this according to need. It's the RegEx where the issue lies.

I Tried this

_TITLE
(.*?)\s*\(.*\)$
$1

...but still the space is there left at the end of the title. It's very stubborn....!

:slight_smile:

The more the example resembles the real thing, the better the suggestions.

For me it works:
grafik

Thanks ohrenkino - this is working now. :slight_smile:

I'm grateful for your help.