protected function notAlphaNumCount($parameter, $password)
    {
        $len = intval($parameter);
        if ($len) {
            $results = array(); // Not used but required
            $count   = strlen($password) - preg_match_all('/[0-9A-Za-z]/', $password, $results);
            if (($len > 0) && ($count < $len)) {
                $this->_addError(sprintf(
                        $this->translate->plural('should contain at least one non alphanumeric character', 'should contain at least %d non alphanumeric characters', $len),
                        $len));
            } elseif (($len < 0) && (($count > 0) || (null === $password))) {
                $this->_addError($this->translate->_('should not contain non alphanumeric characters'));
            }
        }
    }
protected function notAlphaNumCount($parameter, $password)
    {
        $len = intval($parameter);
        if ($len) {
            $results = array(); // Not used but required
            $count   = strlen($password) - preg_match_all('/[0-9A-Za-z]/', $password, $results);
            if (($len > 0) && ($count < $len)) {
                $this->_addError(sprintf(
                        $this->translate->plural('should contain at least one non alphanumeric character', 'should contain at least %d non alphanumeric characters', $len),
                        $len));
            } elseif (($len < 0) && (($count > 0) || (null === $password))) {
                $this->_addError($this->translate->_('should not contain non alphanumeric characters'));
            }
        }
    }
protected function notAlphaNumCount ( $ parameter , $ password ) { $ len = intval ( $ parameter ) ; if ( $ len ) { $ results = array ( ) ; // Not used but required $ count = strlen ( $ password ) - preg_match_all ( '/[0-9A-Za-z]/' , $ password , $ results ) ; if ( ( $ len > 0 ) && ( $ count < $ len ) ) { $ this -> _addError ( sprintf ( $ this -> translate -> plural ( 'should contain at least one non alphanumeric character' , 'should contain at least %d non alphanumeric characters' , $ len ) , $ len ) ) ; } elseif ( ( $ len < 0 ) && ( ( $ count > 0 ) || ( null === $ password ) ) ) { $ this -> _addError ( $ this -> translate -> _ ( 'should not contain non alphanumeric characters' ) ) ; } } }
Test the password for minimum number not alphanumeric characters.

@param mixed $parameter
@param string $password
Test the password for minimum number not alphanumeric characters .