#1 2021-07-18 03:14

grepmoth
Member
Registered: 2020-07-24
Posts: 5

Delete the first parentheses and it's content

Example:

Original Name: Sample song (year) (artist).mp3

After ReNaming: Sample song (artist).mp3

Basically I want to delete the first parentheses and it's content. How to do it?

Thanks!

Offline

#2 2021-07-18 10:52

eR@SeR
Senior Member
From: Земун, Србија
Registered: 2008-01-23
Posts: 345

Re: Delete the first parentheses and it's content

Hi,

Try this RegEx rule:

1) Regular Expressions: Replace expression "\(.+\) (\(.+\))" with "$1" (skip extension)


TRUTH, FREEDOM, JUSTICE and FATHERLAND are the highest morale values which human is born, lives and dies for!

Offline

#3 2021-08-08 08:56

grepmoth
Member
Registered: 2020-07-24
Posts: 5

Re: Delete the first parentheses and it's content

Thanks It works. 

I was having trouble with the code. Finally figured it out. So I'm sharing the screencap if anyone else is also confused...

However... It only works if the parentheses are side by side together. Is it possible to do the same thing even if there's something between the parentheses.

Example


Input: Text (p1) randomtext (p2)

Rename: Text randomtext (p2)

Thanks.

Last edited by grepmoth (2021-08-08 08:56)

Offline

#4 2021-08-08 20:23

Stefan
Moderator
From: Germany, EU
Registered: 2007-10-23
Posts: 1,078

Re: Delete the first parentheses and it's content

grepmoth wrote:

However... It only works if the parentheses are side by side together.
Is it possible to do the same thing even if there's something between the parentheses.

FROM:
Sample song (year) (artist).mp3
Text (p1) randomtext (p2).ext

TO:
Sample song (artist).mp3
Text randomtext (p2).ext

Goal:
delete the first parentheses and it's content



Try to match null-or-more of any sign ".*" between the parentheses:

"\(.+\) .*(\(.+\))"



Note that there is still at least one space matched between the parentheses in the above expression.
You may remove that space if not need to match for to work f.ex. on: "Text (p1)(p2).ext"




See for reference > den4b.com/wiki/ReNamer:Regular_Expressions
. >>> one of any sign (the symbol is just a dot)
* >>> zero or more of the expression before
+ >>> one or more of the expression before
? >>> zero or one  of the expression before




 


Please see HELP and MANUAL in Wiki for more info.
If ReNamer had helped you, please donate a coin to Denis or buy a Pro license for commercial use. (Lite vs Pro)

Offline

Board footer

Powered by FluxBB