How is the speed on the script you are using? Like, if you use this script on a string of several megabytes, how long does it take to get a result? Since you are testing for a number of possible different characters, you are going to have to use a repeat for each char loop - I think.