I have this regex which checks if the password has one number at least.
^(?=.*[0-9]).{6,}$
How do I modify the regex to check of sum of all the digits in the password is equal to say 10.
So this string should match “dhbqdw46”. This shouldn’t “jwhf1ejhjh0”.
New contributor
Akshay is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.