How to Group While Loop “Results” of wp_query?

I will probably do something like this to make it dynamic but this have some issue with the title that must be “Season $n” in the title.

Probably better solution will be to add some custom field with the season or some custom taxonomy just to filter.

if ( $my_query->have_posts() ){

    $seasons = array();
    foreach($my_query->posts as $mypost) {
        preg_match('/Season (\d*)/', $mypost->post_title, $season);
        $seasons[$season[1]][] = $mypost;
    }
    // and then you could use seasons array

}