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

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]

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

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

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

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]

sorry for the stupid question

what goes where?

Regular expression:
Replace with:

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.

I got it thanks to your answer

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

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