public function setPattern(string $pattern = '') : self { if (empty($pattern)) { $this->pattern = ''; } else { $this->pattern = '#' . \preg_quote($pattern, '#') . '#'; } return $this; }