Re: REReplace to avoid HTML elements

2008-11-07 Thread Peter Boughton
we ultimately came up with this: (?![/]#Variables.Word#)(\W)(#Variables.Word#)(\W) The only downside that we found is if the word is at the very end or beginning of the paragraph. That's the \W bits you're using - they're wrong; you want a zero-width word boundary, not a non-word character.

Re: REReplace to avoid HTML elements

2008-11-07 Thread Aaron Rouse
Thanks, I will try that out locally and make a note to apply it the next time I am in there since I already initiated the push process to get the changes into place. On Fri, Nov 7, 2008 at 8:03 AM, Peter Boughton [EMAIL PROTECTED] wrote: we ultimately came up with this:

Re: REReplace to avoid HTML elements

2008-11-07 Thread s. isaac dealey
That's the \W bits you're using - they're wrong; you want a zero-width word boundary, not a non-word character. Use \b(#Variables.Word#)\b and you wont need to do the workaround. Thanks Peter... I'd never used word boundaries... so of course, they don't occur to me when I go to write a

Re: REReplace to avoid HTML elements

2008-11-07 Thread Aaron Rouse
The \b actually did not work, it put the link within the first span element but maybe was how I tested it. I tried: (?![/]sub)(\b)(sub)(\b) as well as (?![/]sub)\b(sub)\b On Fri, Nov 7, 2008 at 10:49 AM, s. isaac dealey [EMAIL PROTECTED] wrote: That's the \W bits you're using - they're

Re: REReplace to avoid HTML elements

2008-11-07 Thread Peter Boughton
The \b actually did not work, it put the link within the first span element but maybe was how I tested it. I tried: (?![/]sub)(\b)(sub)(\b) as well as (?![/]sub)\b(sub)\b Ah, you need to change your \2 to \1 in your replace part. Since the \b is zero-width, it looks like it wont populate a

REReplace to avoid HTML elements

2008-11-06 Thread Aaron Rouse
I have been using REReplace to find key words or group of words within paragraphs and if found to replace those with an HREF. All has been working fine and well until recently when one of those key words became sub and some paragraphs make use of the HTML element SUB. So what I am curious on is

Re: REReplace to avoid HTML elements

2008-11-06 Thread Peter Boughton
I have been using REReplace to find key words or group of words within paragraphs and if found to replace those with an HREF. The following code works. (I haven't yet decided whether it's entirely the best way though...) cfset Content = ListToArray(Content,'')/ cfloop index=i from=1

Re: REReplace to avoid HTML elements

2008-11-06 Thread Aaron Rouse
Thanks Peter, I got to talking to Isaac Dealey this evening about this since he had helped out a while back on this particular project. He mentioned what I need is a lookahead in the regex. After a few tries this is what we ultimately came up with this: