Ok, ok, so I didn't actually try an example in CF :) CF must use a different RegEx engine than what I'm used to using. The ?<! is negative lookbehind because he said he wanted to grab the </organization> tag.
> -----Original Message----- > From: Munson, Jacob [mailto:[EMAIL PROTECTED] > Sent: Thursday, January 05, 2006 6:16 PM > To: CF-Talk > Subject: RE: Regex ex question. How to match NOT this string. > > Steve, > > That causes an error. What's the '<' in between the '?' and '!' > supposed to do (a typo?) > > Ian, > > Try this: > > <cfset MyString = "</organization> <title>"> > <cfset MyResult = > ReFind("(</organization>)(?!\s*<title>)",MyString, 1, > "yes")> > <cfset MyResult2 = ReFind("(</organization>)(?!\s*<div>)",MyString, 1, > "yes")> > <cfoutput>#MyResult.pos[1]#<br>#MyResult2.pos[1]#</cfoutput> > > MyResult = 0 because there was a <title> tag, MyResult2 = 1 because it > looked for a (which wasn't there) <div> tag. So you could > throw that > in a <CFIF MyResult gt 0>, or whatever suits your needs. Is that what > you were looking for? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228653 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

