As far as benchmarking, I finally got some time on our benchmark machine (my request for this wasn't a very high priority). This lab machine is dedicated to timing algorithms. This is a stand-alone machine (no network, no internet), all services, tasks, and processes eliminated, except only those absolutely necessary for windows to allow the timing application to run. This application tests only the algorithms under investigation, and it not affected by execution of the application itself. For example, if you want to measure how long it takes a statement to execute, and you've placed that statement in a loop, this programs factors out the time to do the loop, so that only time of the statement is actually measured. The timer used is the QueryPerformanceCounter.
In this case, for the string "Price299", the CharByChar approach was about 2.7 times faster than the RegExp approach with scoring as follows: CBC-0.0915, RE-0.24945.
However, using the string, "The standard unit price for this item of merchandise is 299.99", the RegExp approach was faster (0.3483) than the CharByChar approach (0.44325).
So, for short string (<= ~45 chars before the number), the CharByChar approach is preferable. For string longer than that, the RegExp approach is superior, and the longer the string, better the relative performance of the RegExp.
Note: You should see how the RegExp Replace function compares to the built-in VB Replace function once you get into longer strings or multiple replaces. We ran those tests about 18 months ago and it was a shock to how much better RegExp performed over the built-in function.
So PHV, Really? Yes, Really. I appreciate that you ran your tests many, many times and averaged the results, with the feeling that any anomolies created by background processes would be evened out over time. Maybe, maybe not, how can any of us be sure. It seems to me that 15 secs (CharByChar) to 22 secs (RegExp) for the string "Price999", seems a little close, although the CharByChar should be faster.
Nevertheless, you still haven't aswered my questions, how sterile is you testing environment, and how isolated is it from the vagaries of a normal Windows production environment, or external interrupts that can come from a LAN/WAN configuration. Which timer are you using?
Good Luck
--------------
To get the most from your Tek-Tips experience, please read FAQ181-2886
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein