I think using a traditional string method is faster and better than using Regex.
I don't know how to write the code in C#, and it's also a little complex is VB,
(VB6 have to convert string into array of byte)
I would write a peice of fake code here,
Let's resume you have a input string as str
For i = 1 to str.length { // resume string character array based on 1
if ((ord(str[i]) <= 33) or(ord(str[i]) >= 126 )) then
str[i] = chr(32);
}
str = Replace(str,chr(32),''); // delete all invalid characters
ord() return the ascii value of a character
chr() return a character of the number
I always use this kind of code in Delphi,
I think it would be easy to convert this code into C#
It's very very fast, and simple.
Actually, this is just what Regex execute Omega's pattern in background.
www.wonderstudio.cn