public function setFormat($format)
    {
        if (empty($format) || !is_string($format)) {

            throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
        }

        if ($format[0] !== '/') {
            $format = '/^' . $format;
        }

        if ($format[strlen($format) - 1] !== '/') {
            $format .= '$/';
        }

        $this->_format = $format;
        return $this;
    }
public function setFormat($format)
    {
        if (empty($format) || !is_string($format)) {

            throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
        }

        if ($format[0] !== '/') {
            $format = '/^' . $format;
        }

        if ($format[strlen($format) - 1] !== '/') {
            $format .= '$/';
        }

        $this->_format = $format;
        return $this;
    }
public function setFormat ( $ format ) { if ( empty ( $ format ) || ! is_string ( $ format ) ) { throw new Zend_Validate_Exception ( "A postcode-format string has to be given for validation" ) ; } if ( $ format [ 0 ] !== '/' ) { $ format = '/^' . $ format ; } if ( $ format [ strlen ( $ format ) - 1 ] !== '/' ) { $ format .= '$/' ; } $ this -> _format = $ format ; return $ this ; }
Sets a self defined postal format as regex

@param string $format
@throws Zend_Validate_Exception On empty format
@return Zend_Validate_PostCode  Provides fluid interface
Sets a self defined postal format as regex