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

Reply via email to