public function valid_postcode($str)
    {
        if (!array_key_exists('valid_postcode', $this->_error_messages)) {
            $this->set_message('valid_postcode', lang('fv_valid_postcode'));
        }

        $pattern = '/^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) {0,1}[0-9][A-Za-z]{2})$/';
        return preg_match($pattern, strtoupper($str)) ? true : false;
    }