]
Sent: Friday, October 17, 2003 8:15 AM
To: CF-Talk
Subject: RE: number of occurrences in a string.
Wouldn't it be "faster" to use a Lower() on the string rather than
REFindNoCase?
I thought that doing a NoCase does the search twice, so on long strings,
it could be slow
ailto:[EMAIL PROTECTED]
Verzonden: vr 17/10/2003 17:01
Aan: CF-Talk
CC:
Onderwerp: RE: number of occurrences in a string.
I'm not a regex guru, but what about using the \b boundry:
This seems to work well. In a UDF you would just return the arrayLen of
foo.pos.
Does
I always assumed it said, match A or a, not search twice. I guess it
depends on what is happening at the lowest level. I've never seen any
recommendations in the past to not use findNoCase or reFindNocase (or
etc).
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User S
day, October 17, 2003 11:02 AM
To: CF-Talk
Subject: RE: number of occurrences in a string.
I'm not a regex guru, but what about using the \b boundry:
This seems to work well. In a UDF you would just return the arrayLen of
foo.pos.
Does this seem right to others?
_
[Todays Thre
Nope, I stand corrected, you still need to loop. But \b may be better
than [^a-z]+.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
I'm not a regex guru, but what about using the \b boundry:
This seems to work well. In a UDF you would just return the arrayLen of
foo.pos.
Does this seem right to others?
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
k bericht-
Van: Raymond Camden [mailto:[EMAIL PROTECTED]
Verzonden: vr 17/10/2003 15:52
Aan: CF-Talk
CC:
Onderwerp: RE: number of occurrences in a string.
What didn't look right about the function? It's working here.
_
[Todays Threads]
[This Mes
What didn't look right about the function? It's working here.
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
I was doing _javascript_ when I posted this. Obviously the first element in the array has index 1 in CF. So replace [0] by [1] in my code.
-Oorspronkelijk bericht-
Van: Pascal Peters
Verzonden: vr 17/10/2003 15:08
Aan: CF-Talk
CC:
Onderwerp: RE: number of occurrences in a
os[0] gt 0){
i=i+1;
start=tmp.pos[0]+tmp.len[0];
}else{
exit = true;
}
}
return i;
}
Pascal
-Oorspronkelijk bericht-
Van: Ketan Patel [mailto:[EMAIL PROTECTED]
Verzonden: vr 17/10/2003 13:42
Aan: CF-Talk
CC:
Onderwerp: RE: number of occurrences in a string.
> What you are returning here is the number if subexpressions of
> the first matching word (will always be 2), NOT the wordcount.
Damn, yes, you're right. I was thinking perl regex. Sorry!
#!/usr/bin/perl
$word = "the";
$string = "q giw fieo the nigeow the woeifnw io fmewo the miwo";
@wordarra
PROTECTED]
Verzonden: vr 17/10/2003 13:59
Aan: CF-Talk
CC:
Onderwerp: RE: number of occurrences in a string.
Try this (watch the wrap):
hint="Counts the number of occurences of a given word in a given
string">
refind("[^[:alpha:]](#argumen
> Will this work in CF5.0 ?
*Now* he says... No, it's MX only. But I _think_ this should do it
(and work on MX too):
function wordcount(word, line) {
var wordarray = refind("[^[:alpha:]](#word#)[^[:alpha:]]", line, 1,
TRUE)>
if (NOT wordarray.len[1]) { return 0; }
return arraylen(w
CTED]
Sent: Friday, October 17, 2003 8:00 AM
To: CF-Talk
Subject: RE: number of occurrences in a string.
> I am looking for which returns the number of occurrences of a word in
a
> string. It should return the word occurrence count when I pass a word
to
> search in a string
> Try this (watch the wrap):
Oops, replace the output="yes" with output="no" in the cffunction
header. Also note that this is a case sensitive search - if you want
case insensitive change the refind(...) to refindnocase(...).
Tim.
---
RAWNET L
> I am looking for which returns the number of occurrences of a word in
a
> string. It should return the word occurrence count when I pass a word
to
> search in a string.
Try this (watch the wrap):
hint="Counts the number of occurences of a given word in a given
string">
refind("[
Does anybody have answer for this .When I use cflib function wordinstance()
sometimes CPU usage will max out ,it reaches its max to 100%. It takes a
good amount of time to open the page. This is the only function which give
me correct results. My concern is when the site will generate good traffic
That's funny, I almost bought Ray the barbie that was previosly listed.
-Original Message-
From: Robyn Follen [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 2:08 PM
To: CF-Talk
Subject: RE: number of occurrences in a string.
Heh... looked at this and thought..
This is getting odd, but I noticed the same thing. I went to a blog,
noticed the guy had his wish list, and when I clicked on it, I saw mine
as well. Is there something special about Amazon wish lists?
Sorry for the OT crap folks, I'll try to make up for it with a good blog
post later today. :)
-1760600> ?
Pretty short!
-robyn
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 2:53 PM
To: CF-Talk
Subject: RE: number of occurrences in a string.
Ahem - without sounding like a total and complete greedy pig, my wish
list is h
Ahem - without sounding like a total and complete greedy pig, my wish
list is here:
http://www.amazon.com/exec/obidos/wishlist/ref=cm_wl_topnav_account/002-
3361200-1675257
Feel free to send on over the 500 dollar IPod. (Sorry, can't help
asking.)
Also I should point out Rob Brooks-Bilson, auth
To: CF-Talk
Sent: Thursday, October 16, 2003 11:34 AM
Subject: RE: number of occurrences in a string.
Would now be a good time to point out the official CFLIB.org Amazon.com
wish list???
-Raymond, who realizes he is WAY behind on the cflib.org queue.
>
> Check out the follow
It couldn't hurt! :)
-Original Message-
From: Raymond Camden [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 1:35 PM
To: CF-Talk
Subject: RE: number of occurrences in a string.
Would now be a good time to point out the official CFLIB.org Amazon.com
wish
it doesn't Sell."
http://www.g3group.com
-Original Message-
From: Philip Arnold [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 2:26 PM
To: CF-Talk
Subject: RE: number of occurrences in a string.
http://www.cflib.org/udf.cfm?ID=146
This sho
Would now be a good time to point out the official CFLIB.org Amazon.com
wish list???
-Raymond, who realizes he is WAY behind on the cflib.org queue.
>
> Check out the following function. Someone on another was
> trying to do this yesterday. CFLib.Org has to be one of the
> best sites for cool
http://www.cflib.org/udf.cfm?ID=146
This should do what you want
-Original Message-
From: Ketan Patel [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 2:21 PM
To: CF-Talk
Subject: number of occurrences in a string.
Hi All,
I am looking for which returns the number of occurre
Check out the following function. Someone on another was trying to do this
yesterday. CFLib.Org has to be one of the best sites for cool tools. :)
http://www.cflib.org/udf.cfm?ID=304
-Original Message-
From: Ketan Patel [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 16, 2003 1:21
27 matches
Mail list logo