LinkURLs - Auto Links with Regular Expressions
30.01.2004
Okuyucu : 3.958
Günlük Okuyucu : 2,5
Okuyucu : 3.958
Günlük Okuyucu : 2,5
Orginally written by Lewis Moten. I modified Regex and fixed some problems about it.
Kaynak Kodunu Download Edin (Download Source Code);
/opensource/source-code/auto-url-regex.txt
Kaynak Kod;
1 : <%
2 : '// Copyright (c) 2000, Lewis Moten (modified by Ferruh Mavituna). All rights reserved.
3 : Function LinkURLs(ByVal asContent)
4 : Dim loRegExp ' Regular Expression Object (Requires vbScript 5.0 and above)
5 :
6 : ' If no content was received, exit the function
7 : If asContent = "" Then Exit Function
8 :
9 : Set loRegExp = New RegExp
10 : loRegExp.Global = True
11 : loRegExp.IgnoreCase = True
13 : '//-- by Ferruh Mavituna {http://ferruh.mavituna.com}
14 : '1/29/2004
15 : '"www" added
16 : '"www." fixed
17 : '"www" fixed etc.
18 : loRegExp.Pattern = "((((ht|f)tps?://)|www\.)\S+[^\.*](\s)?)"
20 : ' Link URLs
21 : LinkURLs = loRegExp.Replace(asContent, "<a href=""$1"">$1</a>")
22 : ' // --
24 : ' Look for email addresses
25 : loRegExp.Pattern = "(\S+@\S+.\.\S\S\S?)"
27 : ' Link email addresses
28 : LinkURLs = loRegExp.Replace(LinkURLs, "<a href=""mailto:$1"">$1</a>")
29 :
30 : ' Release regular expression object
31 : Set loRegExp = Nothing
32 : End Function
33 : %>

Yorumlar
Aşağıdaki form aracılığı ile yorumlarınızı ve fikirlerinizi gönderebilirsiniz. Henüz bu konu hakkında bir yorum yazılmamış.
Yorum Ekle
Diğer Yazılar
Linux ve Özgür Yazılım Şenliği
List and prices updated
LKD Seminerleri
LKD Seminerlerindeyim
Log Dosyası olmadan SQL Server veri tabanı restore etme
Log Parser
Lord Of The Rings Online
Lütfen Bana Spam Gönderin Listesi - Spam Yapan Firmalar
Lütfen beni taş** oğlanı yapın !
Mac - Font Tasarımı
Mac Book Pro, Vista ve Boot Camp Maceraları
Mac OS X Leopard Maceraları - I
Mac, No body gives a shit!
Macar Notasyonu (Hungarian Notation) Muhabbetleri
MacOS, MMORPG, AMD ve Bloglama...
MacOSX' ten Kurtulmak
Macromedia Captivate - Eski RoboDemo
Macromedia da Erişilebilirlik kısıtlaması
Macromedia Dreamweaver 8 ve Fireworks 8
Neredeyim ?
Ferruh.Mavituna » Kod Parçaları (Code Snippets) » LinkURLs - Auto Links with Regular Expressions