# File renaming question

**URL:** https://community.mp3tag.de/t/file-renaming-question/10443
**Category:** Support
**Created:** [May 17, 2010, 2:24pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443 "2010-05-17T14:24:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![matt\_t](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@matt\_t](https://community.mp3tag.de/u/matt_t)
#### Post date: [May 17, 2010, 2:24pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/1 "2010-05-17T14:24:39Z")

</div>

Here's a tricky one for all you experts! (Of which I am most certainly not one 😉 )

How can I rename a file such as:

02-Accompagnato (Tenor). Comfort ye my people.flac

so it becomes simply

02-Comfort ye my people.flac

i.e. remove all characters up to and including the space after the dot, but leave the first 3 characters (the track number) intact?

And another one: 🙂

How to rename e.g.

15-Thou, Merab, first in birth (Recit. Saul, Merab) - My soul rejects (Air. Merab) - See, with what a scornful air - Ah, lovely youth (Air. Michal).flac

to be

15-Thou, Merab, first in birth - My soul rejects - See, with what a scornful air - Ah, lovely youth.flac

i.e. remove all brackets and their contents, and leave only one space either side of the hyphen?

Possibly I'm asking the impossible, but many thanks in advance anyway!!

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 17, 2010, 2:48pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/2 "2010-05-17T14:48:27Z")

</div>

> [@Matt](#):
>
> ... How can I rename a file such as:  
> 02-Accompagnato (Tenor). Comfort ye my people.flac  
> so it becomes simply  
> 02-Comfort ye my people.flac  
> ...

Set Filter: **%\_FILENAME% MATCHES "^.+-.+.\s+.+$"**  
Converter Filename - Filename  
Mask old filename: **%1-%2. %3**  
Mask new filename: **%1-%3**

> [@Matt](#):
>
> ... How to rename e.g.  
> 15-Thou, Merab, first in birth (Recit. Saul, Merab) - My soul rejects (Air. Merab) - See, with what a scornful air - Ah, lovely youth (Air. Michal).flac  
> to be  
> 15-Thou, Merab, first in birth - My soul rejects - See, with what a scornful air - Ah, lovely youth.flac  
> i.e. remove all brackets and their contents, and leave only one space either side of the hyphen?

Set Filter: **%\_FILENAME% MATCHES "^.+-.+\s+(.+)\s+-\s+.+\s+(.+)\s+-\s+.+\s+-\s+.+\s+(.+)$"**  
Converter Filename - Filename  
Mask old filename: **%1-%2 (%3) - %4 (%5) - %6 - %7 (%8)**  
Mask new filename: **%1-%2 - %4 - %6 - %7**

DD.20100517.1858.CEST

---

<div class="post-metadata">

### Author: ![matt\_t](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@matt\_t](https://community.mp3tag.de/u/matt_t)
#### Post date: [May 17, 2010, 3:28pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/3 "2010-05-17T15:28:25Z")

</div>

> [@DetlevD](#):
>
> Set Filter: **%\_FILENAME% MATCHES "^.+-.+.\s+.+$"**  
> Converter Filename - Filename  
> Mask old filename: **%1-%2. %3**  
> Mask new filename: **%1-%3**
> 
> Set Filter: **%\_FILENAME% MATCHES "^.+-.+\s+(.+)\s+-\s+.+\s+(.+)\s+-\s+.+\s+-\s+.+\s+(.+)$"**  
> Converter Filename - Filename  
> Mask old filename: **%1-%2 (%3) - %4 (%5) - %6 - %7 (%8)**  
> Mask new filename: **%1-%2 - %4 - %6 - %7**
> 
> DD.20100517.1858.CEST

Thanks very much, that works a treat!

Sorry, but just one more question regarding my second query: is there an expression which will work however many sets of brackets there are, wherever they occur in the filename? e.g. one that will work for, e.g.:

13-Birth and fortune I despise (Air. David).flac

as well as

15-Thou, Merab, first in birth (Recit. Saul, Merab) - My soul rejects (Air. Merab) - See, with what a scornful air - Ah, lovely youth (Air. Michal).flac

---

<div class="post-metadata">

### Author: ![DetlevD](https://community.mp3tag.de/user_avatar/community.mp3tag.de/detlevd/32/123_2.png) [@DetlevD](https://community.mp3tag.de/u/DetlevD)
#### Post date: [May 17, 2010, 4:06pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/4 "2010-05-17T16:06:37Z")

</div>

> [@Matt](#):
>
> ... is there an expression which will work however many sets of brackets there are, wherever they occur in the filename? e.g. one that will work for, e.g.:  
> 13-Birth and fortune I despise (Air. David).flac  
> as well as  
> 15-Thou, Merab, first in birth (Recit. Saul, Merab) - My soul rejects (Air. Merab) - See, with what a scornful air - Ah, lovely youth (Air. Michal).flac

This might be possible ...  
Set Filter: **%\_FILENAME% MATCHES "\s(.+?)(\s|$)"**  
Action "Format Value"  
Field: **\_FILENAME**  
Formatstring: **$trim($regexp(%\_FILENAME%' ','(\s(.+?)\s)',' '))**

DD.20100517.2006.CEST

---

<div class="post-metadata">

### Author: ![matt\_t](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@matt\_t](https://community.mp3tag.de/u/matt_t)
#### Post date: [May 17, 2010, 4:13pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/5 "2010-05-17T16:13:04Z")

</div>

> [@DetlevD](#):
>
> This might be possible ...  
> Set Filter: **%\_FILENAME% MATCHES "\s(.+?)(\s|$)"**  
> Action "Format Value"  
> Field: **\_FILENAME**  
> Formatstring: **$trim($regexp(%\_FILENAME%' ','(\s(.+?)\s)',' '))**
> 
> DD.20100517.2006.CEST

Detlev, you are a genius! Thank you!

---

<div class="post-metadata">

### Author: ![system](https://community.mp3tag.de/uploads/default/original/2X/c/ce7035d426cb755a7916793326d23b465222a407.png) [@system](https://community.mp3tag.de/u/system)
#### Post date: [February 9, 2026, 12:22pm UTC](https://community.mp3tag.de/t/file-renaming-question/10443/6 "2026-02-09T12:22:23Z")

</div>


