minimumConstraintValue) { return preg_match("/(^\d+)|(\d+$)/", $plaintext_password) != 1; } return TRUE; } function getDescription() { return t('Minimum number of digits in the password to allow a digit in the first or last position in the password (e.g. 2abcdefg and abcdefg4 are unacceptable passwords, while 2qpcxrm3 and 99qpcxrm are allowed passwords when 2 is set here).'); } function getValidationErrorMessage() { return t('Password must have a minimum of %numChars %digits to place any digits at the start or end of the password.', array('%numChars' => $this->minimumConstraintValue, '%digits' => format_plural($this->minimumConstraintValue, t('digit'), t('digits')))); } }