public static function pregSplitArray(array $list, string $pattern): array
    {
        $slices = [];
        $index = -1;
        foreach ($list as $value) {
            if (preg_match($pattern, $value) === 1) {
                ++$index;
            }

            if ($index !== -1) {
                $slices[$index][] = $value;
            }
        }

        return $slices;
    }