getRegexes() as $brand => $regexes) { foreach ($regexes as $regex) { if ($this->matchUserAgent($regex . '[^a-z0-9]+')) { $this->matchedRegex = $regex; return ['brand' => $brand]; } } } return null; } /** * @return string|null */ public function getMatchedRegex(): ?string { return $this->matchedRegex; } }