# Replacement String not working

**URL:** <https://community.mp3tag.de/t/replacement-string-not-working/59224>\
**Category:** Support\
**Created:** [November 28, 2022, 3:33pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224 "2022-11-28T15:33:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul65](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@Paul65](https://community.mp3tag.de/u/Paul65)\
**Post date:** [November 28, 2022, 3:33pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/1 "2022-11-28T15:33:51Z")

</div>

Hi All, Hope one of you wizards can point out what I'm doing wrong please. I've been using MP3Tag for a while but cannot fathom out why I'm stuck on this issue.  
I'm trying to replace the contents between square brackets and not making any progress.  
Here's an example that works exactly as I expect:-  
This one replaces four numerals and text inside parenthesis with just new text also inside parenthesis;  
Regular Expression **((.... Some Text))** Replace Matches With **(New Text)**

I want the same outcome where there are square brackets instead of parenthesis eg:  
Regular Expression **([.... Some Text])** Replace Matches with **[New Text]**

I've tried putting apostrophes around the brackets as follows;  
**('['.... Some Text']')** and also **('[.... Some Text]')** but neither works and leaves the original string unchanged.

Incidentally, If I use the replace command for **"TITLE": "[TEXT]" -\> ""** then it successfully deletes the brackets and the content.  
Am I missing something obvious?

---

<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:** [November 28, 2022, 3:38pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/2 "2022-11-28T15:38:40Z")

</div>

The escape character is `\`.  
So it would be `\[` if you want to use the `[` in the literal sense.

And then it would be much easier for debugging if you could supply the real expression and not just an example that you feel shows the expression.

> [@Paul65](#):
>
> This one replaces four numerals and text inside parenthesis with just new text also inside parenthesis;  
> Regular Expression **((.... Some Text))**

If you really want to narrow down the 4 characters to numbers, then try `\d+` or even `\d\d\d\d`  
Further reading, see the documentation:

> **[Regular Expressions – Mp3tag Documentation](https://docs.mp3tag.de/regex/)**
>
> Documentation on support for regular expressions in Mp3tag. Mp3tag is the universal Tag Editor.

---

<div class="post-metadata">

**Author:** ![Paul65](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@Paul65](https://community.mp3tag.de/u/Paul65)\
**Post date:** [November 28, 2022, 4:16pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/3 "2022-11-28T16:16:22Z")

</div>

Thank you...  
Real expression is [1982 Remaster] and I want [Rem]  
As previous if (1982 Remaster) accurately becomes (Rem) why doesn't it apply the same logic to the square brackets phrase but leaves it intact instead?  
Will try [1982 Remaster] as you suggest.

---

<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:** [November 28, 2022, 4:21pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/4 "2022-11-28T16:21:29Z")

</div>

The round brackets also have a special purpose ...  
So it could be:  
Search string: `\[\d+ .*`  
Replace string: `'['Rem']'`

For (1982 Remaster) it would be:  
Search string: `\(\d+ .*`  
Replace string: `(Rem)`

---

<div class="post-metadata">

**Author:** ![Paul65](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@Paul65](https://community.mp3tag.de/u/Paul65)\
**Post date:** [November 28, 2022, 4:27pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/5 "2022-11-28T16:27:04Z")

</div>

Brilliant, thank you. Spent ages on this and you seem to have done it in 5 minutes. also your round brackets suggestion is much neater too.  
Many thanks.

---

<div class="post-metadata">

**Author:** ![Paul65](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/p/ad7895/32.png) [@Paul65](https://community.mp3tag.de/u/Paul65)\
**Post date:** [November 28, 2022, 9:59pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/7 "2022-11-28T21:59:54Z")

</div>

Thanks - I'll give that a go. Might help clarify some of the parameters and contexts involved.

---

<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:** [December 28, 2022, 10:00pm UTC](https://community.mp3tag.de/t/replacement-string-not-working/59224/8 "2022-12-28T22:00:54Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
