: This wouldn't, though. find AT at the beginning of the string, would it? Good point.
(^| |[^c])at :-) BTW -- just a reminder to Doug and everyone else, http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21 is great for this kind of stuff. About half a dozen ninjas are ready to become your sensei. :-) CF-RegEx, for all your regex needs! -- Ben Doom Programmer & General Lackey Moonbow Software, Inc : -----Original Message----- : From: Jerry Johnson [mailto:[EMAIL PROTECTED] : Sent: Thursday, September 11, 2003 3:58 PM : To: CF-Talk : Subject: RE: Regex help : : : That's why you the ninja. : : This also helps solve his need for an index to just the AT part : of the word, rather than the beginning of the word (which is what : I was shooting towards). : : The find would return all the indexes one character less than the : start of the "at" string. : : This wouldn't, though. find AT at the beginning of the string, would it? : : Thanks for the fixes, : Jerry Johnson : : >>> [EMAIL PROTECTED] 09/11/03 03:47PM >>> : Technically, it doesn't since it doesn't match "at" by itself. : : (^|) This is either the beginning of the string or a space, so the : beginning of a word. Probably unnecessary in this case : : ([^ ]*) This is zero or more non-spaces. In this example, dots and : letters. : : ([^c ]) This is one not-c or not-space. : : at This is "at" :-) : : What you should really be using is : rereplacenocase(str, "([^c]| )at", "\1AT", "all") : which capitalizes all the "at"s except in "cat". : : -- Ben Doom : Programmer & General Lackey : Moonbow Software, Inc : : : -----Original Message----- : : From: Jerry Johnson [mailto:[EMAIL PROTECTED] : : Sent: Thursday, September 11, 2003 2:29 PM : : To: CF-Talk : : Subject: Re: Regex help : : : : : : Hopefully Ben can tell me why this appears to work. : : : : <cfset str="gat...a chat cat hat prate at bird..."> : : : : <cfset f=reReplaceNoCase(str,"(^| )([^ ]*)([^C ])at","\1\2\3AT","ALL")> : : <cfoutput>#f#</cfoutput> : : : : : : Jerry Johnson : : : : : : >>> [EMAIL PROTECTED] 09/11/03 01:32PM >>> : : Regex help please. I've been busting my brain on this one. : : : : Here's what I'm trying to do, I could have string like: : : "...a cat hat prate at bird..." : : And I want to match all the "at" strings except the "at" string in the : : "cat". : : : : I tried a bunch of stuff like: "(^C)?at" but that didn't work. Is this : : possible? : : : : Thanks in advance, Doug : : : : : : : : ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com

