# Replace \[brackets\] with (parentheses) if they contain certain words?

**URL:** <https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594>\
**Category:** Support\
**Created:** [September 27, 2022, 1:21am UTC](https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594 "2022-09-27T01:21:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LW45](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8c91f0/32.png) [@LW45](https://community.mp3tag.de/u/LW45)\
**Post date:** [September 27, 2022, 1:21am UTC](https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594/1 "2022-09-27T01:21:00Z")

</div>

Basically, I want to achieve the _opposite_ of [this thread](https://community.mp3tag.de/t/changing-parentheses-to-brackets-if-they-contain-certain-words/15718).

Here's the formula from that thread:

`$regexp(%TITLE%,'\(([^(]*\b(?:remix|live|mix|edit)\b[^)]*)\)','[$1]',1)`

This does the _inverse_ of what I'm trying to accomplish. I want any brackets containing certain words to be changed to parentheses, so this:

Title: Song Name [Live]

would become this:

Title: Song Name (Live)

Any help is appreciated!

---

<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:** [September 27, 2022, 5:46am UTC](https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594/2 "2022-09-27T05:46:50Z")

</div>

> [@LW45](#):
>
> I want any brackets containing certain words to be changed to parentheses,

Or do you want to replace any square brackets with round brackets?  
Is the list in the expression that you found complete? Or are there other words as well that should trigger the replacement?  
Or do you have square brackets and all of them should be replaced?

If the latter is the case then I would try an action group with 2 actions of the type "Replace" for TITLE  
One to replace `[` with `(`  
and the other to replace `]` with `)`.  
which may be easier to understand.  
Or use  
`$regexp(%TITLE%,'\[([^(]*\b(?:remix|live|mix|edit)\b[^)]*)\]','($1)',1)`

---

<div class="post-metadata">

**Author:** ![LW45](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/8c91f0/32.png) [@LW45](https://community.mp3tag.de/u/LW45)\
**Post date:** [September 27, 2022, 9:58pm UTC](https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594/3 "2022-09-27T21:58:58Z")

</div>

> [@ohrenkino](#):
>
> Or use  
> `$regexp(%TITLE%,'\[([^(]*\b(?:remix|live|mix|edit)\b[^)]*)\]','($1)',1)`

This is exactly what I needed. I had tried to modify the original formula I posted with no success, but now I see what you did and it works perfectly. 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:** [October 27, 2022, 9:59pm UTC](https://community.mp3tag.de/t/replace-brackets-with-parentheses-if-they-contain-certain-words/58594/4 "2022-10-27T21:59:35Z")

</div>

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