Ämne: ASP-problem
Visa ett inlägg
Oläst 2005-01-30, 10:56 #2
andhols avatar
andhol andhol är inte uppkopplad
Medlem
 
Reg.datum: Sep 2004
Inlägg: 141
andhol andhol är inte uppkopplad
Medlem
andhols avatar
 
Reg.datum: Sep 2004
Inlägg: 141
Om du vill läsa mer om regular expressions tycker jag du skall kolla på:
http://www.webeye.nu/default2.asp?qu...lar/asp_11.asp

Då kan du säkert modifera detta uttryck till att trigga enligt dina önskemål, som det är nu triggar det på alla förekomster av http(s):// ftp(s)://

Kod:
<%
text = "Texten som du vill hitta länkar i..."
Set objRegExp = New regexp
objRegExp.Global = true
objRegExp.IgnoreCase = true
objRegExp.Pattern = "(((((ht|f)tp(s?))\://){1}\S+)\b(/?))"
text = objRegExp.Replace(text,"<a href='$1' target='_blank'>$1</a>")
Set objRegExp = Nothing
Response.write text
%>
/Anders Holgersson
andhol är inte uppkopplad   Svara med citatSvara med citat