# Format string - make parentheses into brackets and make text within lower case

**URL:** https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198
**Category:** Support
**Created:** [May 3, 2022, 2:39pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198 "2022-05-03T14:39:29Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![thinlyveileddissent](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@thinlyveileddissent](https://community.mp3tag.de/u/thinlyveileddissent)
#### Post date: [May 3, 2022, 2:39pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/1 "2022-05-03T14:39:29Z")

</div>

Hi all,  
been screwing my head up trying to get this to work. I wonder whether doing two things at once is my problem.

My song title appears like this:  
Puro Rosáceae (KMOS Harmonizer Dub)

I want it to appear like this:  
Puro Rosáceae [kmos harmonizer dub]

To do this I have been using an Action with a Format String as follows: $replace($lower(%title%),'(','[',')',']')

However this results in this:  
puro rosáceae [kmos harmonizer dub]

I understand why, as I'm applying the %lower to my title before doing the parentheses replacement however I can't get my head around how I target the text within the parentheses with the %lower first. I suspect I'm going about this in the wrong way.

Any help appreciated.  
A

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [May 3, 2022, 3:10pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/2 "2022-05-03T15:10:31Z")

</div>

> [@thinlyveileddissent](#):
>
> $replace($lower(%title%),'(','[',')',']')

I would try it in two steps.  
First use this regular expression:  
`$regexp(%TITLE%,(\(.*\)),\L$1)`  
Then in a second step, replace the brackets as you already have it (without the $lower part)

Short explanation for the regexp:  
Search the first opening bracket, put everything following it until a closing bracket into a group.  
Write the content of the captured group in lowercase.

You could write it with this syntax for the capturing part too:  
`\((.*)\)`  
This would not capture the brackets itself. But that doesn't matter in this case, because a bracket looks the same in normal/upper/lowercase 😉

---

<div class="post-metadata">

### Author: ![thinlyveileddissent](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@thinlyveileddissent](https://community.mp3tag.de/u/thinlyveileddissent)
#### Post date: [May 3, 2022, 3:28pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/3 "2022-05-03T15:28:13Z")

</div>

I assume by two steps you mean two separate actions? I have that working now:

Action 1 - brackets in lower case  
Field: TITLE  
Format String: $regexp(%TITLE%,((.\*)),\L$1)

Action 2 - bracket swap  
Field: TITLE  
Format String: $replace(%title%,'(','[',')',']')

I'll have to be conscious what order to apply them, Action 1 then Action 2 as the other way will mean the lower case doesn't occur as the parentheses aren't seen.

Single action would've been lovely (we all love the extra milliseconds gained) but clearly too ambitious for me and I now have a workable solution! Appreciate your help!

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [May 3, 2022, 3:32pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/4 "2022-05-03T15:32:00Z")

</div>

You could put this two actions in ONE Action Group. Then you have to care about the order to apply only once (at the moment you create the group with this two members).

Maybe the forum software [has removed some chars](https://community.mp3tag.de/t/hints-for-asking-support-requests/56190#use-formatting-when-necessary-4) in your $regexp format string, but you should use the `\(` and` \)` for the brackets, not only `((` and `))`

---

<div class="post-metadata">

### Author: ![thinlyveileddissent](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@thinlyveileddissent](https://community.mp3tag.de/u/thinlyveileddissent)
#### Post date: [May 3, 2022, 3:38pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/5 "2022-05-03T15:38:08Z")

</div>

Yeah seems the forum modified it during copy and paste. My Action 1 has format string as per your example, with `\(` and `\)`.

Regards putting them in a single action - it may be beyond my ability - I'll have a play around and try to understand how to make it work.

---

<div class="post-metadata">

### Author: ![LyricsLover](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/l/c6cbf5/32.png) [@LyricsLover](https://community.mp3tag.de/u/LyricsLover)
#### Post date: [May 3, 2022, 3:46pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/6 "2022-05-03T15:46:42Z")

</div>

I'm not sure if you misunderstand my suggestion:

You can put your two single actions as they are and build an action group with them:  
Press ALT + 6 then

![CreateActionGroup](https://community.mp3tag.de/uploads/default/original/2X/8/857441c42b24dd655804163401cb55a1e16263a8.gif)

---

<div class="post-metadata">

### Author: ![thinlyveileddissent](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/t/85f322/32.png) [@thinlyveileddissent](https://community.mp3tag.de/u/thinlyveileddissent)
#### Post date: [May 3, 2022, 3:49pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/7 "2022-05-03T15:49:50Z")

</div>

Ahhhhhhhhh! I understand you now. That makes total sense!

Thank you. Appreciate your patience. I was thinking it to be more complicated.

---

<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: [June 2, 2022, 3:50pm UTC](https://community.mp3tag.de/t/format-string-make-parentheses-into-brackets-and-make-text-within-lower-case/57198/8 "2022-06-02T15:50:21Z")

</div>

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