# Replace term with brackets

**URL:** https://community.mp3tag.de/t/replace-term-with-brackets/69683
**Category:** Support
**Created:** [September 12, 2025, 5:01am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683 "2025-09-12T05:01:10Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![raymondjiii](https://community.mp3tag.de/user_avatar/community.mp3tag.de/raymondjiii/32/17213_2.png) [@raymondjiii](https://community.mp3tag.de/u/raymondjiii)
#### Post date: [September 12, 2025, 5:01am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/1 "2025-09-12T05:01:10Z")

</div>

Hi again, I was having a problem using the $replace function. I had an existing track as:

Let It Grow (San Francisco CA, Winterland Arena, February 2nd 1974)

I want to select all tracks, Convert → Tag - Tag…

I want to change:

(San Francisco CA, Winterland Arena, February 2nd 1974) to

(San Francisco CA, Winterland Arena, February 22nd 1974)

But, I have a space character before the first “(“ both on what is there and what I want to replace with. The syntax seems to be perl like and I was not sure if I should double quote the strings and do I have to escape the “(“ and “)”, should I have a space after the , ?

I tried:

$replace(%title%,(San Francisco CA, Winterland Arena, February 2nd 1974),(San Francisco CA, Winterland Arena, February 22nd 1974))

I was not sure if putting a space after the comma affects things (or do I need quotes):

$replace(%title%, “ (San Francisco CA, Winterland Arena, February 2nd 1974)”, “ (San Francisco CA, Winterland Arena, February 22nd 1974)”)

If this were some code I were writing I would naturally put a space after the commas to help separate the parameters as I have it above.

Could you tell me what would be the full correct syntax for the above?

I had:

Let It Grow (San Francisco CA, Winterland Arena, February 2nd 1974)

And want:

Let It Grow (San Francisco CA, Winterland Arena, February 22nd 1974)

There is one space before the ( and no space after the )

Thanks for you help with this. (This was just one track, I wanted to select all and apply the same replace operation to all.)

---

<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 12, 2025, 6:12am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/2 "2025-09-12T06:12:44Z")

</div>

To escape special characters like brackets in format strings, use the apostrophe:  
`$replace(%title%, ' (San Francisco CA, Winterland Arena, February 2nd 1974)', ' (San Francisco CA, Winterland Arena, February 22nd 1974)')`  
Yet, I wonder: if it is just " 2nd" that needs to be replaced with " 22nd" - why don't you reduce the search and replace terms to avoid the brackets ...?

---

<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: [September 12, 2025, 6:12am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/3 "2025-09-12T06:12:12Z")

</div>

To remove leading (or trailing) spaces you could use the [$trim](https://docs.mp3tag.de/scripting/#string-functions) functions:

| | |
| --- | --- |
| $trim(x,c) | trims all leading and trailing whitespace from the string x. The optional second parameter c specifies the character to trim. |
| $trimLeft(x,c) | trims all leading whitespace from the string x. The optional second parameter c specifies the character to trim. |
| $trimRight(x,c) | trims all trailing whitespace from the string x. The optional second parameter c specifies the character to trim. |

To change` 2nd ` to ` 22nd ` I would use a simple $replace

> `$replace(x,y,z)` returns the string x with all occurrences of string y replaced by string z. Supports multiple parameter pairs y and z.

---

<div class="post-metadata">

### Author: ![raymondjiii](https://community.mp3tag.de/user_avatar/community.mp3tag.de/raymondjiii/32/17213_2.png) [@raymondjiii](https://community.mp3tag.de/u/raymondjiii)
#### Post date: [September 12, 2025, 12:01pm UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/4 "2025-09-12T12:01:17Z")

</div>

Yes, I guess I could’ve done that. But I’m glad to know it’s single quotes to solve this. Thank you.

---

<div class="post-metadata">

### Author: ![astrohip](https://community.mp3tag.de/user_avatar/community.mp3tag.de/astrohip/32/18205_2.png) [@astrohip](https://community.mp3tag.de/u/astrohip)
#### Post date: [September 12, 2025, 6:49pm UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/5 "2025-09-12T18:49:06Z")

</div>

> [@raymondjiii](#):
>
> Let It Grow (San Francisco CA, Winterland Arena, February 2nd 1974)

I have a serious problem with this post. There was no “Let It Grow” on Feb 2. The first performance of LIG in 1974 was Feb 22 (also 23rd, 24th).

😄 😄 😄 ⚡

PS: My first Dead concert, 5-25-74 UCSB, had a Let It Grow!

---

<div class="post-metadata">

### Author: ![raymondjiii](https://community.mp3tag.de/user_avatar/community.mp3tag.de/raymondjiii/32/17213_2.png) [@raymondjiii](https://community.mp3tag.de/u/raymondjiii)
#### Post date: [September 13, 2025, 1:45am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/6 "2025-09-13T01:45:52Z")

</div>

Exactly! That’s why I needed to get this fixed asap! 😉 (Whole point of problem - change 2nd to 22nd)

---

<div class="post-metadata">

### Author: ![poster](https://community.mp3tag.de/user_avatar/community.mp3tag.de/poster/32/4881_2.png) [@poster](https://community.mp3tag.de/u/poster)
#### Post date: [September 13, 2025, 8:32am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/7 "2025-09-13T08:32:17Z")

</div>

> [@raymondjiii](#):
>
> (Whole point of problem - change 2nd to 22nd)

Is there a special reason why you wanted to do this simple task with the converter instead of just editing the title field and change "2" to "22"?

---

<div class="post-metadata">

### Author: ![raymondjiii](https://community.mp3tag.de/user_avatar/community.mp3tag.de/raymondjiii/32/17213_2.png) [@raymondjiii](https://community.mp3tag.de/u/raymondjiii)
#### Post date: [September 13, 2025, 11:17am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/8 "2025-09-13T11:17:17Z")

</div>

If you read the beginning of the thread you’ll can see why. I was simply trying to use replace and there are about 25 tracks with this same error, seems like using replace would be easier/faster???

---

<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 13, 2025, 11:17am UTC](https://community.mp3tag.de/t/replace-term-with-brackets/69683/9 "2025-10-13T11:17:34Z")

</div>

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