protected function compileRegex() { $regex = '~(' . implode(')|(', array_keys($this->tokenMap)) . ')~iA'; return $regex; }