Ok, no doubt this is an easy RegEx question, but not for me.
I have two queries. One returns a set of names, the other a string which may
or may not contain one or more of the names.
I want to check for the existence of a name in the string, and if I find it,
make it a hyperlink.
So far I
Is there a delimited in the list of names (work_string), something that
you can include in your reg ex to anchor it to an entire entry?
Mark
-Original Message-
From: Will Swain [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 5:27 AM
To: CF-Talk
Subject: Regex help looking
Reorder by length so the longer names come first. Also, I think you only
need replace(works_string, artist, a
href='profiles.cfm?e=#profileID#' target='artistWin'#artist#/a, all)
-Original Message-
From: Will Swain [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 5:27 AM
To:
It does really look like your using Regex's. Since you're looking for
strings essentially, can't you just use ReplaceNoCase?
On 4/27/07, Will Swain [EMAIL PROTECTED] wrote:
Ok, no doubt this is an easy RegEx question, but not for me.
I have two queries. One returns a set of names, the other a
that should be It doesn't really look like your using Regex's
On 4/27/07, Zaphod Beeblebrox [EMAIL PROTECTED] wrote:
It does really look like your using Regex's. Since you're looking for
strings essentially, can't you just use ReplaceNoCase?
On 4/27/07, Will Swain [EMAIL PROTECTED] wrote:
No, sadly. It's just a field of text, sometimes the entries (names) are
seperated by commas, sometimes by new lines, but not everything is a name.
A bit of background - basically, this is a text description about an event,
and includes the names of the artists performing. I'm trying to implement
Are the names delimited by something (like commas) or just strung together?
On 4/27/07, Will Swain wrote:
Ok, no doubt this is an easy RegEx question, but not for me.
I have two queries. One returns a set of names, the other a string which may
or may not contain one or more of the names.
I
Hi James,
See my previous reply. They aren't delimited by anything in particular.
Thanks.
will
-Original Message-
From: James Holmes [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 14:27
To: CF-Talk
Subject: Re: Regex help looking for a name in a string.
Are the names delimited by
Sure. But it still wouldn't work. :)
-Original Message-
From: Zaphod Beeblebrox [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 13:56
To: CF-Talk
Subject: Re: Regex help looking for a name in a string.
It does really look like your using Regex's. Since you're looking for strings
I think this is a good approach too, but it will get complicated because
you have to avoid matching text inside an existing already-hyperlinked
bit of text. I suspect that this is less of a regex problem and the
solution will require searching for strings manually, but at least the
solution can
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#,
Hi Bobby,
Out of interest, how would I reorder by length? In the query? MySQL 4.1.7
Thanks
Will
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 13:47
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Reorder by length so the
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
Yes, Do it in your query. Try this...
Select artist
From tablename
Order by length(artist)
-Original Message-
From: Will Swain [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 10:24 AM
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Hi Bobby,
Out of
I dont know what I was thinking but that wont work either. Say you had
Bobby and Bobby Hartsfield
If you replaced Bobby Hartsfield with a link then Bobby... the code would
replace the Bobby within Bobby Hartsfield
You will need to order the names by length descending to make sure the
longer
Or a couple loops
!--- loop the query and replace the names with markers ---
cfloop query=artists
cfset thetext = replacenocase(thetext, artist, **#currentrow#**,
all) /
/cfloop
!--- now loop again and replace the placeholders with their links ---
cfloop query=artists
cfset
Good plan. I reckon that will work. Now to play with the regex...
Cheers
w
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 20:34
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
I don't know what I was thinking but that wont
That's sweet Bobby - seems to work a treat. Thanks very much.
Will
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 20:43
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Or a couple loops
!--- loop the query and replace
Sorry, Should have said that you DO still have to:
order by length(artist) desc
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 3:43 PM
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Or a couple loops
!--- loop
Thanks Bobby, I owe you a beer. And not just for this but for
http://www.acoderslife.com/news/index.cfm?storyid=7 too!!
Will
-Original Message-
From: Bobby Hartsfield [mailto:[EMAIL PROTECTED]
Sent: 27 April 2007 21:21
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Haha! Beer may have played a part in that article... oh and I accept the beer.
;-)
Cheers!
-Original Message-
From: Will Swain [mailto:[EMAIL PROTECTED]
Sent: Friday, April 27, 2007 5:01 PM
To: CF-Talk
Subject: RE: Regex help looking for a name in a string.
Thanks Bobby, I owe you a
21 matches
Mail list logo