src/MatchResult.php
public function group($group): string
    {
        if (! isset($this->matches[$group])) {
            throw RegexFailed::groupDoesntExist($this->pattern, $this->subject, $group);
        }

        return $this->matches[$group];
    }
public function group($group): string
    {
        if (! isset($this->matches[$group])) {
            throw RegexFailed::groupDoesntExist($this->pattern, $this->subject, $group);
        }

        return $this->matches[$group];
    }
public function group ( $ group ) : string { if ( ! isset ( $ this -> matches [ $ group ] ) ) { throw RegexFailed :: groupDoesntExist ( $ this -> pattern , $ this -> subject , $ group ) ; } return $ this -> matches [ $ group ] ; }
Match group by index or name.

@param int|string $group

@return string

@throws RegexFailed
Match group by index or name .