in reply to Length of first captured match
It may be that this is what you are after:
'abc12345' =~ /(\d+)$/; print $+[1] - $-[1]; [download]
Prints:
5 [download]