# Brackets Help

**URL:** https://community.mp3tag.de/t/brackets-help/18516
**Category:** Support
**Created:** [December 13, 2016, 7:37am UTC](https://community.mp3tag.de/t/brackets-help/18516 "2016-12-13T07:37:28Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![rufus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/3ec8ea/32.png) [@rufus](https://community.mp3tag.de/u/rufus)
#### Post date: [December 13, 2016, 7:37am UTC](https://community.mp3tag.de/t/brackets-help/18516/1 "2016-12-13T07:37:28Z")

</div>

I have a bunch of music MP3 files in a folder. Some of them have their title tag set as, for example:

Back Up [Feat. xx] [Album Version]

I want to create an action that will define, if title tag has two pairs of square brackets "[]", the first pair should be replaced with round ones "()"

Back Up (Feat. xx) [Album Version]

Is it possible to create such action (expression) ?

I did find a similar post that does the reverse of what I want so maybe it could be adopted to my needs.

[Brackets HELP](https://community.mp3tag.de/t/12867/3)

Thanks!

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 13, 2016, 7:58am UTC](https://community.mp3tag.de/t/brackets-help/18516/2 "2016-12-13T07:58:28Z")

</div>

> [@Rufud](#):
>
> ...I did find a similar post that does the reverse of what I want so maybe it could be adopted to my needs.

Original from the thread:  
$regexp(%TITLE%,'^([^(]+?)\s(([^(]+?))\s(([^(]+?))$','$1 ($2) [$3]')  
My suggestion:  
$regexp(%TITLE%,'^([^(]+?)\s[([^(]+?)]\s[([^(]+?)]$','$1 ($2) [$3]')

---

<div class="post-metadata">

### Author: ![rufus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/3ec8ea/32.png) [@rufus](https://community.mp3tag.de/u/rufus)
#### Post date: [December 13, 2016, 8:26am UTC](https://community.mp3tag.de/t/brackets-help/18516/3 "2016-12-13T08:26:58Z")

</div>

> [@ohrenkino](#):
>
> Original from the thread:  
> $regexp(%TITLE%,'^([^(]+?)\s(([^(]+?))\s(([^(]+?))$','$1 ($2) [$3]')  
> My suggestion:  
> $regexp(%TITLE%,'^([^(]+?)\s[([^(]+?)]\s[([^(]+?)]$','$1 ($2) [$3]')

This does not work, it gives me a regex error:-

REGEXP ERROR: Regular expression

Found a closing ) with no corresponding openening parenthesis. The error occurred while parsing the regular expression fragment: ')s[([^(]+?\>\>\>HERE\>\>\>)]s[([^(]+'.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 13, 2016, 8:32am UTC](https://community.mp3tag.de/t/brackets-help/18516/4 "2016-12-13T08:32:00Z")

</div>

> [@Rufud](#):
>
> This does not work, it gives me a regex error:-
> 
> REGEXP ERROR: Regular expression
> 
> Found a closing ) with no corresponding openening parenthesis. The error occurred while parsing the regular expression fragment: ')s[([^(]+?\>\>\>HERE\>\>\>)]s[([^(]+'.

Copy & Paste error?

I just tested it with the Tag-Tag-Converter:  
$regexp('Back Up [Feat. xx] [Album Version]','^([^(]+?)\s[([^(]+?)]\s[([^(]+?)]$','$1 ($2) [$3]')

and it leads to  
Back Up (Feat. xx) [Album Version]

---

<div class="post-metadata">

### Author: ![rufus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/3ec8ea/32.png) [@rufus](https://community.mp3tag.de/u/rufus)
#### Post date: [December 13, 2016, 8:32am UTC](https://community.mp3tag.de/t/brackets-help/18516/5 "2016-12-13T08:32:13Z")

</div>

> [@Rufud](#):
>
> This does not work, it gives me a regex error:-
> 
> REGEXP ERROR: Regular expression
> 
> Found a closing ) with no corresponding openening parenthesis. The error occurred while parsing the regular expression fragment: ')s[([^(]+?\>\>\>HERE\>\>\>)]s[([^(]+'.

I see the problem, the forum or a human has lost the double backslashes.

Your code does work with double backslashes.

1=$regexp(%TITLE%,'^([^(]+?)\\s\\[([^(]+?)\\]\\s\\[([^(]+?)\\]$','$1 ($2) [$3]')

Thanks!

---

<div class="post-metadata">

### Author: ![rufus](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/r/3ec8ea/32.png) [@rufus](https://community.mp3tag.de/u/rufus)
#### Post date: [December 13, 2016, 8:33am UTC](https://community.mp3tag.de/t/brackets-help/18516/6 "2016-12-13T08:33:51Z")

</div>

> [@Rufud](#):
>
> I see the problem, the forum or a human has lost the double backslashes.
> 
> Your code does work with double backslashes.
> 
> 1=$regexp(%TITLE%,'^([^(]+?)\\s\\[([^(]+?)\\]\\s\\[([^(]+?)\\]$','$1 ($2) [$3]')
> 
> Thanks!

I have been editing the .mta action file directly with a text editor, double slashes work.

---

<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:26pm UTC](https://community.mp3tag.de/t/brackets-help/18516/7 "2026-02-09T12:26:34Z")

</div>


