<cf_homer>Doh!</cf_homer>
I think I see the problem -- the parens. We must escape the set that's
actually in the text!
<CFSET bodyText = REReplaceNoCase
(publishGetArticleOnContentId.body1,
'^.*<A class=jargon
href="javascript:popUpJargonDefinition\([0-9]*\)">([^<]*)</a>.*$',"\1",
'all')>
I also added 'all' to the rereplacenocase() so that it will strip all
instances of this, rather than just the first one.
Try that. I think it will work better.
-- Ben Doom
Programmer & General Lackey
Moonbow Software, Inc
: -----Original Message-----
: From: Oliver Cookson [mailto:[EMAIL PROTECTED]
: Sent: Thursday, March 20, 2003 4:43 AM
: To: CF-Talk
: Subject: RE: RegEx Help! (more detail)
:
:
: Hi Jochem,
:
:
:
: Thanks for the reply (and the others who replied too!).
:
:
:
: Ok let me explain myself a little better. I am outputting a page of
: text
:
: and if the user chooses to turn off the "jargon" links i want to
: strip
:
: all links that look like this out:
:
:
:
: <A class=jargon
: href="javascript:popUpJargonDefinition(2)">article</A>
:
:
:
: You say that would be easy?
:
:
:
: Well i want to keep the text inbetween the <A></A> tags (in this
:
: case "article") and the argument i am passing to the JS function
: could
:
: be ANY number (from 1 to 2000? As this is the ID of the jargon.)
:
:
:
: I need to replace ALL occurences of this text within the large
: string.
:
:
:
: I tried this RegEx below but it didn't work? (sorry for the
: text-wrap)
:
:
:
: <CFSET bodyText = REReplaceNoCase
:
: (publishGetArticleOnContentId.body1,'^.*<A class=jargon
:
: href="javascript:popUpJargonDefinition([0-9]*)">([^<]*)</a>.*$',"\1")>
:
:
:
: Thanks in advance and any help would be appreciated. :)
:
:
:
: Oliver
:
:
:
:
:
: > : -----Original Message-----
:
: > : From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
:
: > : Sent: Friday, March 14, 2003 6:23 AM
:
: > : To: CF-Talk
:
: > : Subject: Re: SOT: RegEx Help!
:
: > : Do you mean this string is part of a larger text? Use:
:
: > : <cfset text = REReplaceNoCase(text,'^.*<A class=jargon
:
: > :
: href="javascript:popUpJargonDefinition([0-9]*)">(.*)</a>.*$',"\1")>
:
: > : else:
:
: > : <cfset text = REReplaceNoCase(text,'<A class=jargon
:
: > : href="javascript:popUpJargonDefinition([0-9]*)">(.*)</a>',"\1")>
:
: > :
:
: > : Jochem
:
:
:
:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4