I'm trying to figure out a way to count the number of digits in a string that resembles a password.
Currently, I am using this regular expression:
^(?=.*[0-9]{3,})([a-zA-Z0-9_/+*.-]{6,})$
It works well when there are 3 consecutive digits, but not when they are scattered throughout the entire string.
I want to be able to detect if there are 3 digits in strings like these:
h123dasd 1hkh/23jd 1gvbn/*2fefse-
How can I achieve this?