<cfset tContent = REreplacenocase(tContent,'(?!<a href="[^"]+?" class="tag">.*)\bKEYWORD\b(?!.*</a>)','<a href="http://mynewlink/KEYWORD" class="tag">[, ]*KEYWORD[, ]*</a>',"one")> should fix your comma issues. But the P issue... the p is before the A tag? IE: <P...><A href="...">...?
On 1/11/07, Toth, Cory TMC <[EMAIL PROTECTED]> wrote: > > > Currently the only things not working is when a keyword is directly > after "<p>" or a comma is directly after the Keyword. > > Cory > > > > -----Original Message----- > From: Tony Hicks [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 11, 2007 3:22 PM > To: RegEx > Subject: Re: RegEx to automatically link Keywords to URLS > > Do you have examples of what works and what will not wor? > > On 1/11/07, Toth, Cory TMC <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > I'm trying to search content looking for a specific Keyword and then > > Link to a URL about the keyword, The problem I'm running into is when > > the word appears within a link. The code below is partially working > > but will not find the keywords if they are directly after a <p> tag. > > > > <cfset tContent = REreplacenocase(tContent,'(?!<a href="[^"]+?" > > class="tag">.*)\bKEYWORD\b(?!.*</a>)','<a > > href="http://mynewlink/KEYWORD" class="tag">KEYWORD</a>',"one")> > > > > > > Cory > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Create robust enterprise, web RIAs. Upgrade & integrate Adobe Coldfusion MX7 with Flex 2 http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU Archive: http://www.houseoffusion.com/groups/RegEx/message.cfm/messageid:1011 Subscription: http://www.houseoffusion.com/groups/RegEx/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.21
