Ok, this is strange.  That RegEx works in Java.... so CF isn't using the
JDK-provided RegEx implementation?  Looks like it's using the Perl 5
implementation.  Seems counter-productive (if my assumption is correct, of
course).

Anyway, with that implementation, here's what I came up with.

<cfscript>
searchString = "</organization><title>";
matchStruct = StructNew();
matchStruct = REFind("(</organization>)(?=\s*<title>)",searchString,1,true);
trueMatch = Mid(searchString, matchStruct.pos[1], matchStruct.len[1]);
</cfscript>

<cfdump var="#trueMatch#">

> -----Original Message-----
> From: Steve Brownlee [mailto:[EMAIL PROTECTED] 
> Sent: Friday, January 06, 2006 12:07 PM
> To: CF-Talk
> Subject: RE: Regex ex question. How to match NOT this string.
> 
> 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.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:228658
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

Reply via email to