Normalizing Strings

The NormalizeString function receives a string and returns the equivalent string in a regular expression.

Function NormalizeString(OrgStr)
	Dim TempStr
	TempStr = Replace(OrgStr, "\", "\\")
	TempStr = Replace(TempStr, "*", "\*")
	TempStr = Replace(TempStr, "+", "\+")
	TempStr = Replace(TempStr, ".", "\.")
	NormalizeString = Replace(TempStr, "?", "\?")
End function

msgbox NormalizeString ("a+b*c.d?e")