# Replace Action

**URL:** https://community.mp3tag.de/t/replace-action/12376
**Category:** Support
**Created:** [August 11, 2011, 3:00am UTC](https://community.mp3tag.de/t/replace-action/12376 "2011-08-11T03:00:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![BobVal](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/c2a13f/32.png) [@BobVal](https://community.mp3tag.de/u/BobVal)
#### Post date: [August 11, 2011, 3:00am UTC](https://community.mp3tag.de/t/replace-action/12376/1 "2011-08-11T03:00:18Z")

</div>

Hello:

I am trying to write a replace action to look for Open and Closed brackets [] and delete everything within the brackets INCLUDING the bracets.

Can someone show me the expression needed to delete any data between two brackets and the brackets also?

Thanks

BobVal

---

<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: [August 11, 2011, 6:40am UTC](https://community.mp3tag.de/t/replace-action/12376/2 "2011-08-11T06:40:35Z")

</div>

> [@BobVal](#):
>
> Can someone show me the expression needed to delete any data between two brackets and the brackets also?
> 
> Thanks
> 
> BobVal

To give you a more detailled answer it would require to know more about the surrounding parts.  
So I can give you only very general advice:

Create an action of the type "Replace with regular expression".  
the wildcard for a universal string is ".\*"  
To separate and possibly reuse parts of the string, use "(" and ")".  
To address reusable parts of a string, use $1, $2 etc.  
So an expression for string with some text in front, inside and behind the brackets might look like this:

(._)([._])(.\*)  
To leave out the part in [and] enter (which would be string part $2)

$1 $3

---

<div class="post-metadata">

### Author: ![pone](https://community.mp3tag.de/user_avatar/community.mp3tag.de/pone/32/272_2.png) [@pone](https://community.mp3tag.de/u/pone)
#### Post date: [August 11, 2011, 7:09am UTC](https://community.mp3tag.de/t/replace-action/12376/3 "2011-08-11T07:09:46Z")

</div>

Action: Replace with regular expression:  
Field: \_ALL  
Regualar Expression: " \*[.+?]" _(without quotationmarks, just to show the leading space)_  
Replace matches with: "" _(without quotationmarks, just nothing)_

_This solution will leave you a single space if the brackets occur at the begin of a line/field._ _For this case, se a second action:_

Action: Replace with regular expression:  
Field: \_ALL  
Regualar Expression: (^ | $)  
Replace matches with: "" _(without quotationmarks, just nothing)_

_Alternative solution:_

Action: Format Value  
Field: \_TITLE  
Formatstring: $trim($regexp(%title%,' \*[.+?] \*', ))

_This solution works only for one tag field (TILE in th example), not with all fields in one go._

---

<div class="post-metadata">

### Author: ![BobVal](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/c2a13f/32.png) [@BobVal](https://community.mp3tag.de/u/BobVal)
#### Post date: [August 11, 2011, 1:59pm UTC](https://community.mp3tag.de/t/replace-action/12376/4 "2011-08-11T13:59:46Z")

</div>

Thanks so much

---

<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:23pm UTC](https://community.mp3tag.de/t/replace-action/12376/5 "2026-02-09T12:23:16Z")

</div>


