public function checkUser($username = null)
    {
        if ($username === null) {
            $username = $this->user;
        }

        if (strlen($username) == 0) {
            return true;
        }

        $pattern = "/^(" . $this->regex["alphanum"] . "|" . $this->regex["mark"] . "|" . $this->regex["escaped"] . "|[;:&=+$,])+$/";
        $status = @preg_match($pattern, $username);

        if ($status === false) {
            throw new Ts3Exception("URI username validation failed");
        }

        return ($status == 1);
    }
public function checkUser($username = null)
    {
        if ($username === null) {
            $username = $this->user;
        }

        if (strlen($username) == 0) {
            return true;
        }

        $pattern = "/^(" . $this->regex["alphanum"] . "|" . $this->regex["mark"] . "|" . $this->regex["escaped"] . "|[;:&=+$,])+$/";
        $status = @preg_match($pattern, $username);

        if ($status === false) {
            throw new Ts3Exception("URI username validation failed");
        }

        return ($status == 1);
    }
Returns TRUE if the username is valid.

@param  string $username
@throws Ts3Exception
@return boolean