$subject = '[youtube=425,350]NN7XXCDqzVg[/youtube]';$find = '/\[youtube=(.*)\](.*)\[\/youtube\]/im';$replace = '[video]http://www.youtube.com/watch?v=\2[/video]';$result = preg_replace($find, $replace , $subject);