Displaying audio player as preview in audio post in WP3.6

You missed the src part. It should have been:



Go on the Shortcode section of the Audio / Video support in Core post.


$post_content="lorem ipsum dolor  lorem  ipsum ";

if( preg_match( '#\#s', $post_content, $matches ) && preg_match("https://wordpress.stackexchange.com/"([^"]+)"https://wordpress.stackexchange.com/", $matches[0], $m) ){
   echo $m[1]; // echoes http://wpthemetestdata.files.wordpress.com/2008/06/originaldixielandjazzbandwithalbernard-stlouisblues.mp3

  //set as featured 

}

The first regex will get your first shortcode and the second regex will extract the URL from it by looking what’s in between the double quotes.

Note that there is get_shortcode_regex which should also help you.