This may be nothing more than a help file issue. The help file states that \x represents ascii codes. Let's test this assumption. Local $sTestString = "" For $i = 0 To 255 $sTestString &= Chr($i) Next ; $sTestString has a string Length of 255 characters ; Remove all characters $sTestString = StringRegExpReplace($sTestString, "[\x00-\xFF]", "") ; Now $sTestString has a string Length of 27 characters ; What went wrong? For $i = 1 To StringLen($sTestString) ; The following 27 characters w