当前位置:Linux教程 - Php - ubb正则替换

ubb正则替换

请教一个正则,ubb的...谢谢    
[swf=280,225]images/aaa.swf[/swf]
如何解析为:

<embed src="images/aaa.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="280" height="225"></embed>

谢谢..[img][/img]这样的....



$ubb = "[swf=250,225]images/aaa.swf[/swf][swf=280,225]images/aaa.swf[/swf]";
$str = preg_replace('/\[swf=(\d{1,3}),(\d{1,3})\](.*)\[\/swf\]/iU','<embed src="\\3" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="\\1" height="\\2"></embed>',$ubb);
echo "$str";