My SMF forum contains posts with video and I want to extract them to show on the Wordpress main page. My current regexp (thanks to SO!) extracts the url of the videos, which I embed using AutoEmbed.
Everything works up until a post looks like this:
<embed height="600" width="600" allowscriptaccess="never" quality="high" loop="true" play="true" src="http://mmavlog.net/embed/player.swf?file=http://video.ufc.tv/CSG/UFC113/20100507_ufc113_weigh_in_400k.flv" type="application/x-shockwave-flash">
Here is my current regexp:
$regexp = "/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i";
Since the posts can contain <embed>
or <object>
I realize that looking for the url by the "http" might be inaccurate. How can I use the regexp to look for "src=" for <embed>
and "data=" for <object>
?