Get list of shortcodes from content

Here’s one way:

You can look at has_shortcode() and find the parsing there:

preg_match_all( 
    "https://wordpress.stackexchange.com/" . get_shortcode_regex() . "https://wordpress.stackexchange.com/", 
    $content, 
    $matches, 
    PREG_SET_ORDER
);

using the get_shortcode_regex() function for the regex pattern.

For non empty matches, you can then loop through them and collect the full shortcode matches with:

$shortcodes = [];
foreach( $matches as $shortcode ) {
    $shortcodes[] = $shortcode[0];
}

Finally you format the output to your needs, e.g.:

echo join( '', $shortcodes );

PS: It can be handy to wrap this into your custom function.