Unfortunately, AFAIK there is no way top make a regex which replaces "one of these" with "one of those".
You can clean it up a bit, by using a MatchEvaluator to remove the need for a String builder. Make the regex just a list of known invalid characters and:
result = myRegex.Replace(input, New MatchEvaluator(AddressOf ReplaceSpecials))
Private Function ReplaceSpecials(match As Match) As String
Select Case Asc(match.Value(0))
Case 63
Return "'"
Case 133
Return "."
End Select
Return "*"
End Function
This isn't tested, but you get the general idea: See
MSDN[
^] for better details.
-- KSCHULER EDIT: Added the "AddressOf" keyword that was missing to correct syntax and removed ;