You're welcome, Ben.
Okay, I see. What you are calling 'Brute Force', which I think of as a random attack, with no upper boundary, is probably better described a linear, or sequential, search algorithm. That is, you line up your elements and process them one by one, along your line. This line is finite, however.
It's probably the most common type of algorithm, VLookup() uses it when you pass a False argument. It uses a Binary search when you pass a True argument (4th), but the requirement is that your array must be sorted.
This is not the case here, your array of characters, and the ones you want to isolate are random, and sorting does you no good.
RegExp looks like it's doing less work because all of the underlying code is buried in the Class, but I'd have to bet it's using a linear search as well, as it too must evaluate all characters in your string, or array of characters... Proof's in the pudding, though. Check out the timing on RegExp vs. my Byte Array search/manipulation implementation.
To be fair, though, the approach posted in this thread is doing something you really do not want to do, and that is binding with RegExp on every single function call. That's very expensive, with all due respect, no good for a UDF used over a large Range.
The linear algorithm is not inherently bad in this case, minimizing the iteration and expensive ops (complex function calls), in other words, optimizing it, is the trick. Here's an example:
http://www.mrexcel.com/board2/viewtopic.php?p=804807#804807
Note how you only have to iterate through half of the array, versus the entire thing!
Some thing, here. We do not need to cycle through the entire 2nd Byte array, which is constructed with a buffer, so that we can avoid ReDim Preserve, which is expensive, in a loop. We also ditched strConv() as it too is expensive...
The other trick to consider in implementing a linear search algo, is to consider what you're iterating through. A Range is slow, very fat in memory, look at what the Object in question has to support in terms of properties! The Byte Array is light in terms of memory, limited in terms of what it can support, but extremely fast to iterate through, as a result.
If you're going to have a go at a large Range of Strings with this, I'd personally stick with performance as one of your main objectives.
Food for thought.
