> -----Original Message-----
> From: Michael Dinowitz [mailto:[EMAIL PROTECTED]
> Sent: Friday, December 31, 2004 10:06 AM
> To: RegEx
> Subject: spot check
>
> I'm adding some code to the list archives to take any link posted and turn
> it into a 'real' link. This is the code I'm using:
> REReplace(text, '\b(https?://[^\b ]+)\b', '<A HREF="\1"
> target="_blank">\1</A>', 'all')
>
> Does anyone see any problems with it. Any place it could fail? Any
> suggestions?
> Thanks
Looks good to me - the only thing I might suggest is a looser check that
would also grab plain links ("www.site.com") as well as those with HTTP.
It might key off of common prefixes ("www" and "ftp" for example), then look
for a dot, any alphanumerics, then one or more dot plus two or two
characters (this would catch international links as well).
Jim Davis
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Silver Sponsor - New Atlanta
http://www.newatlanta.com
Message: http://www.houseoffusion.com/lists.cfm/link=i:21:791
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/21
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:21
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54