You were close: you need to copy .* With character classes in your face forward:
^(?=(.*[^A-Za-z0-9]){3})(?=(.*[AZ]){3})(?=(.*\d){3}).+
The reason for this is that character types may not be adjacent, for example, 3 digits may be a1b2c3 , therefore .* Allow other intermediate character types.
Note that you do not need open-end quantifiers. for example, (.*\d){3} enough to say that there are at least three digits, i.e. not ...{3,}
One final note: these leading / trailing slashes have nothing to do with regular expressions - they are an artifact of the application language. This makes the questions and answers more clear and useful for more people if they are omitted.
source share