OK, here's the deal.
I'm using a richtextbox for an editor app.

I need to search through a lot of the characters in a file to look for a match - I need to do this recursively,
so speed is important - I may have several thousand characters to test.

I can get the current position of the caret with this:
curpos = editbox.selstart

I can get the char at the caret with this:
curchar = mid(editbox.text,curpos,1)

However, when I open some text files, there seems to be extra control chars at the end of each line.
This makes the Mid() function inaccurate since it counts these extra chars, even though SelStart does not.

Without processing the entire file (speed is imprtant here) how can I account for these extra chars?

Is there another way to get the "current char" without using Mid() ?
Also, if I Select the current char, it'll flash the window a lot and be quite slow.
Any suggestions?