Hi all,

I have a small forum running which removes all html from posting.  To make it easier to navigate I want to be able to create links if a user has entered a link from the site the forum is running on.

I.e.

If some posts a post such as "go to www.hotmail.com its cool" then I do not want it to be a link (which it isnt) however if someone posts something like... "I like this story www.mydomain.com/foo.cfm" then I want it to have a link.

I currently have the following as a Regex which nearly works

<CFSET sRegex = "(http://www\.domain\.|www\.mydomain\.)[?&./=[:alnum:]]*([[:space:]]|$)">

<CFOUTPUT>#ReReplaceNoCase(sEntry, sRegex, "<a href=''>\1</a>", "ALL")#</CFOUTPUT>

However it doesn�t fill the href with the whole string it matches, just www.domain.

Does anyone know how I could amend this so that the whole match is replaced?

TIA

Mikey
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to