How to modify this regex to add up all digits to a number?

I have this regex which checks if the password has one digit at least.

^(?=.*[0-9]).{6,}$

How do I modify the regex to check if the sum of all the digits in the password is equal to say 10.
So this string should match “dhbqdw46”. This shouldn’t “jwhf1ejhjh0”.