Unfortunately I don't think there's any regular expression replacement in mysql, so you'd have to write a script, or maybe export the post table to a text file, do a replacement on it in an editor or something (maybe by a command line tool in linux), then import it again. But I did figure out a pattern, I think, so in a vbulletin php script it would be something like:
PHP Code:
$posts = $vbulletin->db->query_read("SELECT postid, pagetext FROM ".TABLE_PREFIX."post WHERE pagetext LIKE '%[ame%' ");
while ($post = $vbulletin->db->fetch_array($posts))
{
if (($new_pagetext = preg_replace('/\[ame="(.*?)"].*?\[\/ame]/i', '[url]$1[/url]', $post['pagetext'])) != NULL &&
$new_pagetext !== $post['pagetext'])
{
$vbulletin->db->query_write("UPDATE ".TABLE_PREFIX."post SET pagetext='".$vbulletin->db->escape_string($new_pagetext)."' WHERE postid={$post['postid']} ");
}
}