# Regular Expression Needed, Please

**URL:** <https://community.mp3tag.de/t/regular-expression-needed-please/14457>\
**Category:** Support\
**Created:** [February 16, 2013, 5:51pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457 "2013-02-16T17:51:40Z")\
**Posts on this page:** 8\
**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:** [February 16, 2013, 5:51pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/1 "2013-02-16T17:51:40Z")

</div>

Hi

I need it to rename one hundred sequentially numbered albums. Notice that in the following examples the number format is not exactly the same all over.

**Current Name**  
My File Vol. 001  
My File Vol. 2  
My File Vol. 03  
My File Vol. 004  
... up to My File Vol. 100

The new sequentially numbered album names should look like this:

**New Name**  
My File Vol. 001^100  
My File Vol. 002^100  
My File Vol. 003^100  
My File Vol. 004^100  
... up to My File Vol. 100^100

You will have noticed that it is only the numbered portion of the album name that needs to be changed.

Thank you for your help.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [February 16, 2013, 7:03pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/2 "2013-02-16T19:03:10Z")

</div>

> [@ragtag](#):
>
> **Current Name**  
> My File Vol. 001  
> My File Vol. 2  
> My File Vol. 03  
> My File Vol. 004  
> ... up to My File Vol. 100
> 
> The new sequentially numbered album names should look like this:
> 
> **New Name**  
> My File Vol. 001^100  
> My File Vol. 002^100  
> My File Vol. 003^100  
> My File Vol. 004^100  
> ... up to My File Vol. 100^100

Make sure your files are sorted like they are in ascending order like above.

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **TITLE** _Formatstring:_ **$regexp(%title%,'(.+?vol\.)\s\*\d+$',$1 $num(%\_counter%,3)'^'%\_total\_files%,1)**

End Action Group **\_Script Test#TEST** (1 Action)

**Results:**

 _"My File Vol. 001" -\>_

"My File Vol. 001^5"

 

"My File Vol. 2" -\>  
"My File Vol. 002^5"

 

"My File Vol. 03" -\>  
"My File Vol. 003^5"

 

"My File Vol. 004" -\>  
"My File Vol. 004^5"

 

_"My File Vol. 100" -\>  
"My File Vol. 005^5"_  
   
As You can see it keeps the text before the no and the counts the files then places a '^' and then a total file count to top it off.

 

As you can see this will work no matter if you have a 100 or 25 files. You don't need to go changing it every time a different situation arises.

---

<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:** [February 17, 2013, 7:28am UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/3 "2013-02-17T07:28:36Z")

</div>

Thank you stevehero, for the effort you have put into figuring this out. Forgive me though, as the use of regular expressions (regex) is absolutely foreign to me and when I applied your regex it did not deliver the results I expected. Undoubtedly though, this was due to my own inability to correctly, or clearly, express my predicament to start off with. On top of this, I was most probably also applying it wrongly.

I realize now that I need to be much more careful when I describe where and what it is I need the regex to do. For instance, it is 100 **albums** that I need to renumber - each of which may contain any number of files. I thought I could easily adapt your supplied regex by changing some of the parameters in your format string before applying it again, but I only kept on shooting myself in the foot. It was/is great fun, however. 🙂

In the end, I gave up, and I certainly would appreciate a prod in the right direction.

Thanks again.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [February 17, 2013, 9:58pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/4 "2013-02-17T21:58:52Z")

</div>

> [@ragtag](#):
>
> In the end, I gave up, and I certainly would appreciate a prod in the right direction.
> 
> Thanks again.

All you need to change is the field to ALBUM and in the format string change %title% to %album% while keeping the rest of the string.

Make sure to sort the album column by clicking the title of the column making sure they are sorted in ascending order with vol 1 being at the top.

Select all files (ctrl + A) and apply the action.

---

<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:** [February 18, 2013, 5:07am UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/5 "2013-02-18T05:07:54Z")

</div>

> [@stevehero](#):
>
> All you need to change is the field to ALBUM and in the format string change %title% to %album% while keeping the rest of the string.
> 
> Make sure to sort the album column by clicking the title of the column making sure they are sorted in ascending order with vol 1 being at the top.
> 
> Select all files (ctrl + A) and apply the action.

Thanks, stevehero.

Sad to report that impatience completely messed up the renaming for me. While I should have waited for your response, I opted to fool around - which I did pretty good and ended up with the mess. Now I seem to have only two options left: do it the long way or start afresh, but this time with the ALBUM field completely blank. What I still do have to start with, is the album-directory/folder already correctly named (e.g. My Album Vol. 001^100 up to My Album Vol. 100^100), but how do I transfer that to the album field, using a regular expression?  
.

---

<div class="post-metadata">

**Author:** ![stevehero](https://community.mp3tag.de/user_avatar/community.mp3tag.de/stevehero/32/337_2.png) [@stevehero](https://community.mp3tag.de/u/stevehero)\
**Post date:** [February 19, 2013, 12:37pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/6 "2013-02-19T12:37:29Z")

</div>

> [@ragtag](#):
>
> ...is the album-directory/folder already correctly named (e.g. My Album Vol. 001^100 up to My Album Vol. 100^100), but how do I transfer that to the album field, using a regular expression?  
> .

Please have a read of the FAQs. ([HERE](https://community.mp3tag.de/c/faq-frequently-asked-questions)) Particularly this section. ([HERE](https://community.mp3tag.de/t/967/15))

Begin Action Group **\_Script Test#TEST**

**Action #1** _Actiontype 5:_ **Format value** _Field \_\_\_\_\_\_:_ **TITLE** _Formatstring:_ **%\_directory%**

End Action Group **\_Script Test#TEST** (1 Action)

---

<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:** [February 19, 2013, 2:48pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/7 "2013-02-19T14:48:42Z")

</div>

Thank you.

---

<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 9, 2026, 12:24pm UTC](https://community.mp3tag.de/t/regular-expression-needed-please/14457/8 "2026-02-09T12:24:20Z")

</div>


