RE: number of occurrences in a string.

2003-10-17 Thread Barney Boisvert
]   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

RE: number of occurrences in a string.

2003-10-17 Thread Pascal Peters
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

RE: number of occurrences in a string.

2003-10-17 Thread Raymond Camden
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

RE: number of occurrences in a string.

2003-10-17 Thread Philip Arnold
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

RE: number of occurrences in a string.

2003-10-17 Thread Raymond Camden
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]

RE: number of occurrences in a string.

2003-10-17 Thread Raymond Camden
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]

RE: number of occurrences in a string.

2003-10-17 Thread Pascal Peters
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

RE: number of occurrences in a string.

2003-10-17 Thread Raymond Camden
What didn't look right about the function? It's working here. [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

RE: number of occurrences in a string.

2003-10-17 Thread Pascal Peters
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

RE: number of occurrences in a string.

2003-10-17 Thread Pascal Peters
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.

RE: number of occurrences in a string.

2003-10-17 Thread Tim Blair
> 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

RE: number of occurrences in a string.

2003-10-17 Thread Pascal Peters
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

RE: number of occurrences in a string.

2003-10-17 Thread Tim Blair
> 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

RE: number of occurrences in a string.

2003-10-17 Thread Ketan Patel
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

RE: number of occurrences in a string.

2003-10-17 Thread Tim Blair
> 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

RE: number of occurrences in a string.

2003-10-17 Thread Tim Blair
> 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("[

RE: number of occurrences in a string.

2003-10-17 Thread Ketan Patel
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

RE: number of occurrences in a string.

2003-10-16 Thread Bryan F. Hogan
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..

RE: number of occurrences in a string.

2003-10-16 Thread Raymond Camden
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. :)

RE: number of occurrences in a string.

2003-10-16 Thread Robyn Follen
-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

RE: number of occurrences in a string.

2003-10-16 Thread Raymond Camden
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

Re: number of occurrences in a string.

2003-10-16 Thread Charlie Griefer
  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

RE: number of occurrences in a string.

2003-10-16 Thread Bryan F. Hogan
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

RE: number of occurrences in a string.

2003-10-16 Thread Ketan Patel
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

RE: number of occurrences in a string.

2003-10-16 Thread Raymond Camden
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

RE: number of occurrences in a string.

2003-10-16 Thread Philip Arnold
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

RE: number of occurrences in a string.

2003-10-16 Thread Bryan F. Hogan
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