
March 25th, 2003, 10:53 PM
|
|
Contributing User
|
|
Join Date: May 2002
Location: Urbana, MD, USA
Posts: 66
Time spent in forums: < 1 sec
Reputation Power: 7
|
|
|
Auto-link URLs in text
This is a common question I've seen accomplished with regex in PERL, but I need to somehow write a function or regex that will hyperlink URLs in text in CF(5)'s limited implementation of RegEx. What I've got so far works for ftp, http, https and uses the first space as the end of a URL.
<CFSET OutText = REReplaceNoCase(form.InText,"((ftp|https?)://[^ \t\n<]*)","<a href=""\1"">\1</a>","All")>
However, I want primarily to be able to not link end punctuation [.,?!] with the URL. I'd also like to be able to NOT auto-link URLs that are already within <a href=""></a>tags (or even within >url< tags.
Thanks in advance.
|