# Format string to remove unwanted characters

**URL:** <https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870>\
**Category:** Support\
**Created:** [February 15, 2020, 1:08am UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870 "2020-02-15T01:08:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![spinner410](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@spinner410](https://community.mp3tag.de/u/spinner410)\
**Post date:** [February 15, 2020, 1:08am UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870/1 "2020-02-15T01:08:29Z")

</div>

Hi there 🙂

I current have an action on the \_DIRECTORY to rename the folder using the following action after I tag the FLACs using Discogs:

Format Value "\_DIRECTORY": %artist% - %album% '('%mediatype%')' '['%publisher%, %CATALOGID%']'

When I rename the folder, it gives me this:

Genius GZA - Shadowboxin' 4th Chamber (CD (Maxi-Single, Promo)) [Geffen Records, PRO-CD-4853]

I want to replace this:

(CD (Maxi-Single, Promo))

with:

(CD, Maxi-Single, Promo)

Thanks in advance for any help!!

---

<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:** [February 15, 2020, 8:02am UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870/2 "2020-02-15T08:02:23Z")

</div>

Provided there are never any brackets in the album part ..  
I would use an action group with 2 actions of the type simple "Replace"  
first,  
Search: `_(`  
Replace: `,_`  
(where the underscore represents a space character)  
second:  
Search: ))  
Replace: )

---

<div class="post-metadata">

**Author:** ![spinner410](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/s/97f17d/32.png) [@spinner410](https://community.mp3tag.de/u/spinner410)\
**Post date:** [February 15, 2020, 3:49pm UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870/3 "2020-02-15T15:49:42Z")

</div>

Hi thanks for your help. The second part of the example you gave me worked like a charm 🙂

Here is an example of what I am working with:  
Little Indian - One Little Indian (CD (Single, Promo) [Premeditated, PRO-CD-7804]

What I want to do is replace all instances of (anydata (anydata,anydata) so it looks like

(anydata, anydata, anydata)

I basically just want to remove the 2nd ( in that particular section of the string and replace it with a comma.

I am guessing I can use this to search

Search:

` \(.*\(.*\)`

but what do I 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:** [February 15, 2020, 4:44pm UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870/4 "2020-02-15T16:44:28Z")

</div>

Try:  
Search string:`(.*) \((.*)`  
Replace string: `$1, $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:** [March 16, 2020, 4:44pm UTC](https://community.mp3tag.de/t/format-string-to-remove-unwanted-characters/47870/5 "2020-03-16T16:44:39Z")

</div>

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