protected function setType($type)
{
//if a client mistakenly creates a regex State (a name of [not-]<regex:>), but with a non-regex type,
//we will set it to a regex state.
if ($this->isRegex()) {
$type = self::TYPE_REGEX;
}
$this->type = trim($type);
return $this;
}