Last number in %album% to become %discnumber% using regular expression

Hello, greetings all.

I want to use regular expression
(\d+)(?!.*\d)
to extract the last number in %album% and apply that as %discnumber%.

I want to create it as a part of action group.

I am currently using $right(%album%,1) method, but want to create a more general method using regular expressions.

But with regular expressions, I can't get around achieving this using $regexp, $format, or $replace

I also thought vaguley about using $if or $if2 as a hack to achieve it but no success since yesterday.

Any suggestions will be helpful. Thanks in deed, and good day.

this thread is in German but you will see that the problem of getting a number from the end of TITLE into YEAR is very similar to getting a number from the end of ALBUM into DISCNUMBER:

Hello and thanks. I understand that $1 should do the trick. There is some progress, and I have tested the regular expression formula, but I am not getting the intended result.
Album name without quotes: 'Dance Vol. 10 ABC'
format discnumber
$regexp(%album%,(\d+)(?!.*\d),$1)
leads to discnumber as
Dance Vol. 10 ABC
instead of the expected and intended
10

Thank you for your further help in the matter. I also will play around more and report.

Yes, because it does not match the pattern that you described in

That pattern reads: a number followed by any string followed by a number.
But
Dance Vol. 10 ABC
is: any string, a number, any string. it does not even have the number at the end.
If a regular expression does not find a match, it returns the source string.
Also, I wonder which results you got when you referenced $1 instead of $2 which is actually the number at the end of the string.
Please note that the linked thread uses
$regexp(%title%,.*(\d\d\d\d),$1)
If you do not have 4-digit numbers at the end, then use
$regexp(%title%,.*(\d\+),$1)
Still, this does not cater for

which would be
$regexp(%title%,.*Vol. (\d\+).*,$1)