public function isValid($tag) { if (strlen($this->tagPrefix) > 0 && strpos($tag, $this->tagPrefix) !== 0) { return false; } return preg_match('/^' . $this->regex . '$/', substr($tag, strlen($this->tagPrefix))) == 1; }