private function extractRange($range)
    {
        if (\preg_match('/^\d+$/', $range)) {
            return [$range, $range + 1];
        }

        $matches = [];
        if ($range !== '..' && \preg_match('/^(\d*)\.\.(\d*)$/', $range, $matches)) {
            $start = $matches[1] ? \intval($matches[1]) : 0;
            $end   = $matches[2] ? \intval($matches[2]) + 1 : PHP_INT_MAX;

            return [$start, $end];
        }

        throw new \InvalidArgumentException('Unexpected range: ' . $range);
    }
private function extractRange($range)
    {
        if (\preg_match('/^\d+$/', $range)) {
            return [$range, $range + 1];
        }

        $matches = [];
        if ($range !== '..' && \preg_match('/^(\d*)\.\.(\d*)$/', $range, $matches)) {
            $start = $matches[1] ? \intval($matches[1]) : 0;
            $end   = $matches[2] ? \intval($matches[2]) + 1 : PHP_INT_MAX;

            return [$start, $end];
        }

        throw new \InvalidArgumentException('Unexpected range: ' . $range);
    }
private function extractRange ( $ range ) { if ( \ preg_match ( '/^\d+$/' , $ range ) ) { return [ $ range , $ range + 1 ] ; } $ matches = [ ] ; if ( $ range !== '..' && \ preg_match ( '/^(\d*)\.\.(\d*)$/' , $ range , $ matches ) ) { $ start = $ matches [ 1 ] ? \ intval ( $ matches [ 1 ] ) : 0 ; $ end = $ matches [ 2 ] ? \ intval ( $ matches [ 2 ] ) + 1 : PHP_INT_MAX ; return [ $ start , $ end ] ; } throw new \ InvalidArgumentException ( 'Unexpected range: ' . $ range ) ; }
Extract a range from a string.

@param string $range

@return array [ start, end ]
Extract a range from a string .