%
texto = "kkk[swf]sitiodeldia.swf:123:444:cccccf[/swf]kkk"
p =instr(1, texto, "[swf]", 1)
z = mid(texto, p + 5, 1)
str = texto
p =instr(1, str, "[swf]", 1) 'busca si esta el tag de swf
f =instr(1, str, "[/swf]", 1) 'marca el final
poffset = p + 5 'para que comienze bien la busqueda (despues que termina el tag
foffset = f - 1
nombre = ""
ancho = "275"
alto = "200"
fondo = "ffffff"
colTemp = ""
estado = 1
marca1= 0
marca2= 0
marca3= 0
for i = poffset to foffset
test = mid(str, i, 1)
if test = ":" then
Select case estado
case 1
marca1 = i
estado = 2
case 2
marca2 = i
estado = 3
case 3
marca3 = i
estado = 4
end Select
end if
next
if marca1 > 0 then
nombre = mid(str, poffset, marca1 - poffset)
end if
if marca2 > 0 then
ancho = mid(str, marca1 + 1, marca2 - marca1 - 1)
end if
if marca3 > 0 then
alto = mid(str, marca2 + 1, marca3 - marca2 - 1)
colTemp = mid(str, marca3 + 1, foffset - marca3)
end if
if colTemp <> "" then
fondo = colTemp
end if
if ancho > 700 then
ancho = 700
end if
if alto > 500 then
alto = 500
end if
objeto = "
"
borrar = mid(str, p, f - p + 6)
str = replace(str, borrar, objeto, 1, -1, 1)
response.write(str)
%>