Hi
This can be done using the profile password verification function (PASSWORD_VERIFY_FUNCTION).
You can use / customize the function provided with the here under SAP note to fulfill your needs.
Regards
1522952 - Password Complexity Verification Function
To enable the password verification function
ALTER PROFILE SAPUPROF LIMIT PASSWORD_VERIFY_FUNCTION verify_function_sap;
sap_utlpwdmg.sql serves as a template for SAP. You can customize this function according your password policy requirements.