public function validate($input) { $valid = mb_substr($this->chars, 0, $this->base); return (bool) preg_match("@^[{$valid}]+\$@", (string) $input); }