public function __toString()
{
if (count($this->chars) === 0) {
if ($this->negateMe) {
return ".";
}
throw new Exception("What");
}
if (count($this->chars) === 1 && $this->negateMe === false) {
return $this->chars[0];
}
if ($this->negateMe) {
return "[^" . implode("", $this->chars) . "]";
}
return "[" . implode("", $this->chars) . "]";
}