# Replace (Prod by XXX) to \[Prod. by XXX\]

**URL:** https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330
**Category:** Support
**Created:** [May 17, 2022, 8:03pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330 "2022-05-17T20:03:47Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [May 17, 2022, 8:03pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/1 "2022-05-17T20:03:47Z")

</div>

Hello,

is there a way to replace the title like this with regex?

my regex is pretty rusty lol

01.title (Prod by XXX)  
to  
01.title [Prod. by XXX]

---

<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: [May 17, 2022, 8:06pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/2 "2022-05-17T20:06:36Z")

</div>

If you want to replace `Prod`with `Prod.` then it is a simple replace.  
There is an action for that.

> **[Replace – Mp3tag Documentation](https://docs.mp3tag.de/actions/replace/)**
>
> Documentation on the Replace action type that can be performed as Quick Action or as reusable workflow from Action Groups. Mp3tag is the universal Tag Editor.

The same applies if you want to replace opening and closing brackets with their square equivalents.

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [May 17, 2022, 8:16pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/3 "2022-05-17T20:16:43Z")

</div>

Sorry that I expressed myself unclearly.

I have files in the following format:

01.title (Prod by XXX)  
02.title (feat YYY)  
03.title (feat ZZZ) [Prod. by XXX]

it just has to be recognized whether Prod by is in the string and only then the brackets are replaced

thx for your help

this should come out in the end:

01.title [Prod. by XXX]  
02.title (feat YYY)  
03.title (feat ZZZ) (Prod by XXX

---

<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: [May 17, 2022, 8:20pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/4 "2022-05-17T20:20:18Z")

</div>

you could try:  
`$regexp('03.title (feat ZZZ) (Prod by XXX)','(.*)\(Prod(.*)\)',$1'['Prod.$2']')`  
Which leads to  
`03.title (feat ZZZ) [Prod. by XXX]`

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [May 17, 2022, 8:34pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/5 "2022-05-17T20:34:49Z")

</div>

> [@ohrenkino](#):
>
> $regexp('03.title (feat ZZZ) (Prod by XXX)','(._)(Prod(._))',$1'['Prod.$2']')

sorry for the stupid question

what goes where?

Regular expression:  
Replace with:

---

<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: [May 17, 2022, 8:39pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/6 "2022-05-17T20:39:39Z")

</div>

Scripting functions can be used in format strings.  
So an action of the type "Format value" would be good. Or the Converter\>Tag-Tag.

You have not yet mentioned which field you want to modify.

---

<div class="post-metadata">

### Author: ![Bomba](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/b/df705f/32.png) [@Bomba](https://community.mp3tag.de/u/Bomba)
#### Post date: [May 17, 2022, 8:51pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/7 "2022-05-17T20:51:25Z")

</div>

I got it thanks to your answer

Field: TITLE  
Regular expression: `(.*)\(Prod(.*)\)`  
Replace with: `$1[Prod.$2]`

---

<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 16, 2022, 8:52pm UTC](https://community.mp3tag.de/t/replace-prod-by-xxx-to-prod-by-xxx/57330/8 "2022-06-16T20:52:07Z")

</div>

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