pattern = sprintf('/^%s$/', strtr(preg_quote($name, '/'), ['\\?' => '.', '\\*' => '.*'])); } public function accepts(Instrument $instrument, InstrumentationScopeInterface $instrumentationScope): bool { return (bool) preg_match($this->pattern, $instrument->name); } }