<%
Function ReplaceTags(strPattern, strReplace, strSource)
Dim objRX : Set objRX = New RegExp
objRX.IgnoreCase = True
objRX.Global = True
objRX.Pattern = strPattern
ReplaceTags = objRX.Replace(strSource, strReplace)
End Function
strText = "Din text/innehåll"
strText = ReplaceTags("\[youtube\](.+)\[\/youtube\]", "<object width=""320"" height=""240""><param name=""movie"" value=""$1""></param><param name=""wmode"" value=""transparent""></param><embed src=""$1"" type=""application/x-shockwave-flash"" wmode=""transparent"" width=""320"" height=""240""></embed></object>", strText)
response.write strText
%>
Frågan#1
Jag vill från en text göra om ALLA förekommande
[youtubeMovie]http://www.youtube.com/v/d1iEtjs6S80[/youtubeMovie]
till
<object width="320" height="240"><param name="movie" [B]value="' + url + '"[/B]></param><param name="wmode" value="transparent"></param>
<embed [B]src="' + url + '"[/B] type="application/x-shockwave-flash" wmode="transparent" width="320" height="240"></embed></object>
Kunde gått med Replace om koden inte innehöll länken på två ställen.
