the for loop isn't right:
1. if it doesn't find a match, it continues looping
2. if there is a match, start will become greater than the string length
3. the word is not escaped for special chars in regexp
4. when the new start position is set, it isn't set to the right place (should be +Len(word)+2, but this isn't a problem, it is just not efficient).
Look at the code I posted, I think it will be more efficient. Maybe the 4th attribute of REFindNoCase can be dropped and the length to add can be calculated from the original word before escaping.
-----Oorspronkelijk 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 Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- RE: number of occurrences in a string. Ketan Patel
- RE: number of occurrences in a string. Robyn Follen
- RE: number of occurrences in a string. Raymond Camden
- RE: number of occurrences in a string. Bryan F. Hogan
- RE: number of occurrences in a string. Tim Blair
- RE: number of occurrences in a string. Pascal Peters
- RE: number of occurrences in a string. Tim Blair
- RE: number of occurrences in a string. Pascal Peters
- RE: number of occurrences in a string. Raymond Camden
- RE: number of occurrences in a string. Pascal Peters
- RE: number of occurrences in a string. Pascal Peters
- RE: number of occurrences in a string. Raymond Camden
- RE: number of occurrences in a string. Raymond Camden
- RE: number of occurrences in a string. Philip Arnold
- RE: number of occurrences in a string. Raymond Camden
- RE: number of occurrences in a string. Barney Boisvert
- RE: number of occurrences in a string. Pascal Peters