[PLAIN]//[video]http://somesite.com/test.divx[/video]
$s = preg_replace("/\[video\]((www.|http:\/\/|https:\/\/)[^\s]+(\.divx))\[\/video\]/i",
"<param name=filename value=\\1/><embed width=470 height=310 src=\\1></embed>", $s);
//[video]http://somesite.com/test.avi[/video]
$s = preg_replace("/\[video\]((www.|http:\/\/|https:\/\/)[^\s]+(\.avi))\[\/video\]/i",
"<object classid=\"clsid:67DABFBF-D0AB-41fa-9C46-CC0F21721616\" width=\"470\" height=\"310\" codebase=\"http://go.divx.com/plugin/DivXBrowserPlugin.cab\"><param name=\"autoPlay\" value=\"false\" /><param name=\"custommode\" value=\"Stage6\" /><param name=\"mode\" value=\"null\" /><param name=\"autoPlay\" value=\"false\" /><param name=\"allowContextMenu\" value=\"false\" /><param name=\"src\" value=\"\\1\" /><embed type=\"video/divx\" src=\"\\1\" custommode=\"Stage6\" width=\"470\" height=\"310\" mode=\"null\" autoPlay=\"false\" allowContextMenu=\"false\" pluginspage=\"http://go.divx.com/plugin/download\"></embed></object>", $s);
//[video]http://somesite.com/test.wmv[/video]
$s = preg_replace("/\[video\]((www.|http:\/\/|https:\/\/)[^\s]+(\.wmv))\[\/video\]/i",
"<param name=filename value=\\1/><embed width=470 height=310 src=\\1></embed>", $s);
//[video]http://somesite.com/test.mp4[/video]
$s = preg_replace("/\[video\]((www.|http:\/\/|https:\/\/)[^\s]+(\.mp4))\[\/video\]/i",
"<object id=\"MediaPlayer\" width=\"310\" height=\"280\" classid=\"CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" standby=\"Loading Windows Media Player components...\" type=\"application/x-oleobject\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112\"><param name=\"filename\" value=\"\\1\"><param name=\"Showcontrols\" value=\"True\"><param name=\"autoStart\" value=\"True\"><embed type=\"application/x-mplayer2\" src=\"\\1\" name=\"MediaPlayer\" width=\"310\" height=\"280\"> </embed></object>", $s);
//[video]http://somesite.com/test.swf[/video]
$s = preg_replace("/\[video\]((www.|http:\/\/|https:\/\/)[^\s]+(\.swf))\[\/video\]/i",
"<param name=movie value=\\1/><embed width=470 height=310 src=\\1></embed>", $s);
//[video=http://somesite.com/test.swf]
$s = preg_replace("/\[video=((www.|http:\/\/|https:\/\/)[^\s]+(\.swf))\]/i",
"<param name=movie value=\\1/><embed width=470 height=310 src=\\1></embed>", $s);
//[audio]http://somesite.com/file.mp3[/audio]
$s = preg_replace("/\[audio\]((www.|http:\/\/|https:\/\/)[^\s]+(\.mp3))\[\/audio\]/i","<embed autostart=false loop=false controller=true width=220 height=42 src=\\1></embed>", $s);
//[video]YouTube Vids url[/video]
$s = preg_replace("/\[video\][^\s'\"<>]*youtube.com.*v=([^\s'\"<>]+)\[\/video\]/ims", "<object width=\"500\" height=\"410\"><param name=\"movie\" value=\"http://www.youtube.com/v/\\1\"></param><embed src=\"http://www.youtube.com/v/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $s);
//[video]Dailymotion Vids url[/video]
$s = preg_replace("/\[video\][^\s'\"<>]*dailymotion.com\/swf\/([^\s'\"<>]+)\[\/video\]/ims", "<object width=\"425\" height=\"356\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/\\1\"></param><embed src=\"http://www.dailymotion.com/swf/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $s);
// [video]Google Vids url[/video]
$s = preg_replace("/\[video\][^\s'\"<>]*video.google.com.*docid=(-?[0-9]+).*\[\/video\]/ims", "<embed style=\"width:500px; height:410px;\" id=\"VideoPlayback\" align=\"middle\" type=\"application/x-shockwave-flash\" src=\"http://video.google.com/googleplayer.swf?docId=\\1\" allowScriptAccess=\"sameDomain\" quality=\"best\" bgcolor=\"#ffffff\" scale=\"noScale\" wmode=\"window\" salign=\"TL\" FlashVars=\"playerMode=embedded\"> </embed>", $s);
//[swf]http://somesite.com/test.swf[/swf]
$s = preg_replace("/\[swf\]((www.|http:\/\/|https:\/\/)[^\s]+(\.swf))\[\/swf\]/i",
"<param name=movie value=\\1/><embed width=470 height=310 src=\\1></embed>", $s);
//[swf=http://somesite.com/test.swf]
$s = preg_replace("/\[swf=((www.|http:\/\/|https:\/\/)[^\s]+(\.swf))\]/i",
"<param name=movie value=\\1/><embed width=435 height=145 src=\\1></embed>", $s);
//[video]Dailymotion Vids url[/video]
$s = preg_replace("/\[video\][^\s'\"<>]*dailymotion.com\/swf\/([^\s'\"<>]+)\[\/video\]/ims", "<object width=\"425\" height=\"356\"><param name=\"movie\" value=\"http://www.dailymotion.com/swf/\\1\"></param><embed src=\"http://www.dailymotion.com/swf/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $s);
//[video]Allociné[/video]
$s = preg_replace("/\[video\][^\s'\"<>]*allocine.fr\/blogvision\/([^\s'\"<>]+)\[\/video\]/ims", "<object width=\"425\" height=\"356\"><param name=\"movie\" value=\"http://www.allocine.fr/blogvision/\\1\"></param><embed src=\"http://www.allocine.fr/blogvision/\\1\" type=\"application/x-shockwave-flash\" width=\"500\" height=\"410\"></embed></object>", $s);[/PLAIN]