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

Hello, greetings all.

I want to use regular expression
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
leads to discnumber as
Dance Vol. 10 ABC
instead of the expected and intended

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.
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
If you do not have 4-digit numbers at the end, then use
Still, this does not cater for

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