# Album volume to discnumber action (general method using regexp)

**URL:** <https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490>\
**Category:** Support\
**Created:** [June 30, 2020, 8:49am UTC](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490 "2020-06-30T08:49:59Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![dev91618](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dev91618](https://community.mp3tag.de/u/dev91618)\
**Post date:** [July 8, 2020, 11:23am UTC](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490/22 "2020-07-08T11:23:54Z")

</div>

Hello and thanks. This is working except when the digits are followed by comma colon or brackets. I tried to navigate through include a strategy that after encountering the required digits, when first non-digits are encountered, the expression stops looking and return. But I haven't had success owing to my extremely limited knowledge of regex.

> [@Crissov](#):
>
> If the trailing dot is actually optional, you need to add a question mark in the proper place.
> 
> `$regexp(%album%,^.*\bVol(?:\.|ume)?\s*(\d+).*$,$1)`

---

<div class="post-metadata">

**Author:** ![dev91618](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/d/b19c9b/32.png) [@dev91618](https://community.mp3tag.de/u/dev91618)\
**Post date:** [July 15, 2020, 8:11am UTC](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490/23 "2020-07-15T08:11:26Z")

</div>

Hello again.

If somehow this regex

> [@Crissov](#):
>
> `$regexp(%album%,^.*\bVol(?:\.|ume)?\s*(\d+).*$,$1)`

can also take care of cases when the volume number is proceeded by bracket, comma, semi-clon, or colon (actually anything that's not a digit) it would be perfect. Thanks a lot.

> [@dev91618](#):
>
> (Vol 5)  
> Vol 5,  
> Vol 5:

---

<div class="post-metadata">

**Author:** ![Crissov](https://community.mp3tag.de/user_avatar/community.mp3tag.de/crissov/32/6619_2.png) [@Crissov](https://community.mp3tag.de/u/Crissov)\
**Post date:** [July 15, 2020, 10:10am UTC](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490/24 "2020-07-15T10:10:54Z")

</div>

It already does, though. You can add them explicitly, but please note that it is very cumbersome to match paired parentheses in regular expressions.

```
$regexp(%album%,^.*\(?Vol(?:\.|ume)?\s*(\d+)[,:)]?.*$,$1)
```

---

<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:28pm UTC](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490/25 "2026-02-09T12:28:41Z")

</div>



[Previous page](https://community.mp3tag.de/t/album-volume-to-discnumber-action-general-method-using-regexp/49490.md?page=1)
