# RegEx to remove Square Brackets

**URL:** <https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961>\
**Category:** Support\
**Created:** [June 12, 2015, 11:12pm UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961 "2015-06-12T23:12:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [June 12, 2015, 11:12pm UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961/1 "2015-06-12T23:12:02Z")

</div>

Sorry if I have missed it but I cannot get any of the suggestions on this forum to work with the track below.

But what I am after is 2 regex's

Firstly i have this track

**Niney The Observer - Blood And Fire [12 Version].mp3**

I would line a regex to remove the Square brackets and everything within them

and the one that just removed the brackets.

Thanks in advance for any help

---

<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:** [June 13, 2015, 7:05am UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961/2 "2015-06-13T07:05:32Z")

</div>

> [@Dego](#):
>
> ... Firstly i have this track  
> **Niney The Observer - Blood And Fire [12 Version].mp3**  
> I would line a regex to remove the Square brackets and everything within them and the one that just removed the brackets. Thanks in advance for any help

**Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\s\*\[.+\]$',)**

**from:  
Niney The Observer - Blood And Fire [12 Version]  
to:  
Niney The Observer - Blood And Fire**

 **Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\[(.+)\]','$1') From: Niney The Observer - Blood And Fire [12 Version].mp3 To: Niney The Observer - Blood And Fire 12 Version.mp3**

DD.20150613.1121.CEST

To make sure to see only files having a filename with opening and closing square brackets, then for example set the Mp3tag Filter to ...  
"%\_FILENAME%" HAS "[" AND "%\_FILENAME%" HAS "]"

... or ...

To make sure to see only files having a filename with a square bracket clamp at end of the filename, then for example set the Mp3tag Filter to ...  
"$regexp(%\_filename%,'^.+?[.+?]$',)" IS ""

DD.20150614.1840.CEST

---

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [June 13, 2015, 3:59pm UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961/3 "2015-06-13T15:59:37Z")

</div>

> [@DetlevD](#):
>
> **Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\s\*\[.+\]$',)**
> 
> **from:  
> Niney The Observer - Blood And Fire [12 Version]  
> to:  
> Niney The Observer - Blood And Fire**
> 
> **Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\[(.+)\]','$1') From: Niney The Observer - Blood And Fire [12 Version].mp3 To: Niney The Observer - Blood And Fire 12 Version.mp3**
> 
> DD.20150613.1121.CEST

---

<div class="post-metadata">

**Author:** ![cldcp00](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/c/838e76/32.png) [@cldcp00](https://community.mp3tag.de/u/cldcp00)\
**Post date:** [June 13, 2015, 4:01pm UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961/4 "2015-06-13T16:01:15Z")

</div>

> [@DetlevD](#):
>
> **Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\s\*\[.+\]$',)**
> 
> **from:  
> Niney The Observer - Blood And Fire [12 Version]  
> to:  
> Niney The Observer - Blood And Fire**
> 
> **Action "Format value" ... or ... Convert "Tag-Tag" Tag-Field: \_FILENAME Formatstring: $regexp(%\_filename%,'\[(.+)\]','$1') From: Niney The Observer - Blood And Fire [12 Version].mp3 To: Niney The Observer - Blood And Fire 12 Version.mp3**
> 
> DD.20150613.1121.CEST

Thanks DetlevD

Much appreciated

---

<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:25pm UTC](https://community.mp3tag.de/t/regex-to-remove-square-brackets/16961/5 "2026-02-09T12:25:42Z")

</div>


