02-27-2013, 09:57 AM
Hi,
Please use the below function. It receives a normal string and returns the equivalent string in regular expression
Please use the below function. It receives a normal string and returns the equivalent string in regular expression
Code:
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")