Yes, I'm in agreement. I wondered if a regex was the answer here, but I have
no idea.

Interestingly, if I reverse the order of the query I still get the same
result, which is odd and not what I'd expect. I did a cfdump of the query to
check it is ordered correctly.

I'm beginning to think an alternative approach might be in order here...

-----Original Message-----
From: Leitch, Oblio [mailto:[EMAIL PROTECTED] 
Sent: 27 April 2007 14:48
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.

Well, I've got a couple of comments, for what they're worth.  First, you're
not using RegEx.  Next, it appears that what you're doing here:

        <cfset works_string = qry_getEvent.works>
 
        <cfloop query="qry_getProfiles">
         <cfset works_string = REReplaceNoCase(#works_string#, #artist#, "<a
        href='profiles.cfm?e=#profileID#'
target='artistWin'>#artist#</a>",       "ALL")>
        </cfloop>

is you have two queries, one of the event(s), one grabbing a list of
artists.  Are you sorting the artists?  It looks to me like when you loop
over the artists, you're simply getting "John Smith" first.  So, you have a
statement like "change all occurrences of 'John Smith'", which it does.  On
the next pass, your statement reads "change all occurrences of 'John Smith &
Sons'", but it doesn't find any.

Now, using this method, you could easily run into other problems.  Say you
sort the artists query to avoid the above.  What happens when (reverse
alphabetically) you've just replaced some string "Smith"?
Then, when it gets to "J", it will fail both "John Smith" and "John Smith &
Sons".

Trying to do this programmatically will be very challenging and you might
not like the result.

This email message may contain privileged and/or confidential information.
If you are not the intended recipient(s), you are hereby notified that any
dissemination, distribution, or copying of this email message is strictly
prohibited. If you have received this message in error, please immediately
notify the sender and delete this email message from your computer.

CAUTION: The Agency of Human Services cannot ensure the confidentiality or
security of email transmissions.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:276397
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to