# Regular Expression Sought to Change Name Pattern of Multi-Disc Albums

**URL:** <https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801>\
**Category:** Support\
**Created:** [January 26, 2023, 10:47am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801 "2023-01-26T10:47:21Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 26, 2023, 10:47am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/1 "2023-01-26T10:47:21Z")

</div>

Hello Everyone,

I need a regular expression, please, with which to modify the naming convention of multi-disc albums, which are named according to the following pattern:

Album Name (CD 1^6)  
Album Name (CD 2^6)  
Album Name (CD 3^6)  
etc.

_To this pattern:_

Album Name . CD1  
Album Name . CD2  
Album Name . CD3  
etc.

Thank you for your consideration.

---

<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:** [January 26, 2023, 10:53am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/2 "2023-01-26T10:53:02Z")

</div>

Why not start with simple replace actions?

1. Step: Replace all Space and Opening Bracket CD with Space and Dot and Space and CD _(--\> do you really want to change it this way?)_
2. Step: Replace all Space 1^6 Closing Bracket with 1
3. Step: Replace all Space 2^6 Closing Bracket with 2  
and so on

If you have more different patterns, we could start thinking about regular expressions too.

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 26, 2023, 11:03am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/3 "2023-01-26T11:03:36Z")

</div>

Thank you, I started out using the Replace-action, but configured it incorrectly. I will now try again, using your proposal.

Yes, I want to do it that way. However, thank you for the heads-up. Do you see anything wrong with it that I am not aware of?

---

<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:** [January 26, 2023, 11:13am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/4 "2023-01-26T11:13:21Z")

</div>

> [@ragtag](#):
>
> Do you see anything wrong with it that I am not aware of?

Your naming convention is not wrong at all, maybe slightly unusual? 😉

I myself would not use a dot in an ALBUM name, not in the tag and not in the file-/foldername (if you plan to later use the ALBUM content for building a file/folderstructure.)  
I would write the CD number into the tag DISCNUMBER (for mp3) and not as part of the ALBUM name.

But you can name your files and fill your tags to whatever you like, it's your collection.

> [@ragtag](#):
>
> but configured it incorrectly.

If you like, you can show us what you already have tried, maybe we can spot any syntax errors?

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 26, 2023, 11:23am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/5 "2023-01-26T11:23:07Z")

</div>

By the way, every time the total number of discs in a multi-disc album changes, a new set of replace actions needs to be added to take care of the new total?

> Blockquote  
> I applied your Replace-proposal just now. It works just fine, but I made another mistake in setting it up.

Fixed the error I made.

PS. Would regex not take care of the difference in the total number of albums?

---

<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:** [January 26, 2023, 12:34pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/6 "2023-01-26T12:34:35Z")

</div>

> [@ragtag](#):
>
> By the way, every time the total number of discs in a multi-disc album changes, a new set of replace actions needs to be added to take care of the new total?

Sorry, I'm not sure if I fully understand the situation.  
Do you ask, if in a next multidisc set with 7 or 8 discs (the number after the ^ character?) you have to adapt the replace actions?

You could try it with this "replace with regular expression"-action:  
_This expects that you have the content already in the tag ALBUM_  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/c/c00a667cb415309b4b64688434e0d40a8a838c6a.png)

Regular expression:  
`\(CD (.*)\^\d+\)`  
Replace matches with:  
`CD$1`

Explanation:  
 ![image](https://community.mp3tag.de/uploads/default/original/2X/0/052bba64b602fbaad8b1556d59db3a1c5d99334c.png)

Search for `(CD` and Space  
Group together whatever follows until the ^ character one (or more) digit(s) and a closing bracket.  
_Replace matches with_  
`CD` and the content of the group

If you really want to see a dot as divider between the existing album name and the CD-part, you could use this _replace matches with_ string:  
`\. CD$1`

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 26, 2023, 2:54pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/7 "2023-01-26T14:54:57Z")

</div>

You could also use the Action "Guess Values" if all of the albums follow this structure.  
Action (Quick): `Guess Values`  
Source format: `%album%`  
Guessing pattern: `%album% (CD %discnumber%^%totaldiscs%)`

I would filter for all of your multi-disc albums first, this will ensure you only apply this action to those files. Something like this may work if you don't use the ^ character elsewhere:  
`%album% HAS "^"`

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 26, 2023, 2:56pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/8 "2023-01-26T14:56:21Z")

</div>

Thank you very much, LyricsLover, and I do apologise for my brief explanation. I had to cut it short due to local scheduled power blackouts, and cannot use the PC yet.

Just to confirm, there are very numerous multi-disc, pretagged (Mp3tag) albums for which I have previously used the e.g. (CD1^6) naming convention that is described in my original post. The ALBUM fields of those albums are indeed appropriately tagged according to the album name, and the disc number, followed by the total number of discs. In the renaming of these, the pattern has to change, as also described in my first post, using the exact same album name, adding the dot and correct disc number.

I am going to utilise your proposal at the first opportunity to do so.

---

<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:** [January 26, 2023, 3:00pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/9 "2023-01-26T15:00:58Z")

</div>

> [@MotleyG](#):
>
> Guessing pattern: `%album% (CD %discnumber%^%totaldiscs%)`

Would this not remove the` (CD %discnumber%^%totaldiscs%)` part entirely from the ALBUM tag?  
`Album Name (CD 1^6)`  
would become  
`Album Name`  
On the other side, you would fill the DISCNUMBER and TOTALDISCS with the values  
1 and 6 for the above example.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 26, 2023, 3:50pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/10 "2023-01-26T15:50:27Z")

</div>

It does, but I agree with you that using this info and . characters in the album field aren’t particularly ideal. However once this info has been moved to those fields, you can always use them to rebuild the album names any way you choose.

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 26, 2023, 4:23pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/11 "2023-01-26T16:23:24Z")

</div>

Thank you very much to you both, LyricsLover and MotleyG, for your suggestions. I have a lot of catching up to do on operations/actions I have already forgotten how to do, therefore I have to figure it out anew. I guess I was putting too much hope on a quick way out.

---

<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:** [January 26, 2023, 4:42pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/12 "2023-01-26T16:42:54Z")

</div>

Let us know if you need help for a specific Mp3tag problem or action.  
A real example from your collection with the current status and the expected status is useful too.

---

<div class="post-metadata">

**Author:** ![MotleyG](https://community.mp3tag.de/user_avatar/community.mp3tag.de/motleyg/32/440_2.png) [@MotleyG](https://community.mp3tag.de/u/MotleyG)\
**Post date:** [January 26, 2023, 5:07pm UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/13 "2023-01-26T17:07:24Z")

</div>

> [@ragtag](#):
>
> I have a lot of catching up to do on operations/actions I have already forgotten how to do, therefore I have to figure it out anew.

There are plenty of options to work with. Often the most simple are the best way to go. So try not to overcomplicate things.

> [@ragtag](#):
>
> I guess I was putting too much hope on a quick way out.

This can often lead to making bigger problems later on. So just think about how you really want your library to be managed, then go about migrating what you have now to follow that. There is no "perfect" way to do this, except what works for you.

---

<div class="post-metadata">

**Author:** ![ragtag](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ragtag/32/13146_2.png) [@ragtag](https://community.mp3tag.de/u/ragtag)\
**Post date:** [January 27, 2023, 9:31am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/14 "2023-01-27T09:31:01Z")

</div>

@LyricsLover:

You have absolutely nailed it, and saved the day for me with your proposed regular expression. Fortunately, too, I did keep the ALBUM tag content consistent over time, as per example shown in the original post. Therefore, applying the action is a cinch.

Thank you, I am very grateful for it, as I am now putting the finishing touches to my music library.

---

<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:** [February 26, 2023, 9:31am UTC](https://community.mp3tag.de/t/regular-expression-sought-to-change-name-pattern-of-multi-disc-albums/59801/15 "2023-02-26T09:31:48Z")

</div>

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