Hi Susana,
The regex that you have is working correctly. Kindly find attached oml and check the password regex match. IF you have any special case that is not working than kindly share the strings.

We need to use regex_search method and it takes regex pattern , string to validate and few other inputs and it gives output found as bool. If the string matches the pattern than it gives true other wise false.
There are few online tools available in that you can create the regex expression below are few links.
https://regex101.com/
https://regexr.com/
Hope this will help you,
Best Regards
Devendra