07-28-2008, 06:50 PM
My answer is also same and resembels like Anku and Surya's comments but still to make easiar to understand i m ginving the expample here. Hope it may helpful for Kamal
Regards
Raj
Code:
'Function ReplaceTest(patrn, replStr)
Dim regEx, str1 ' Create variables.
str1 = "hello1234"
Set regEx = New RegExp ' Create regular expression.
patrn="hello1234"
replStr="hello"
regEx.Pattern = patrn ' Set pattern.
regEx.IgnoreCase = True ' Make case insensitive.
ReplaceTest = regEx.Replace(str1, replStr) ' Make replacement.
'End Function
MsgBox ReplaceTest ' Replace 'fox' with 'cat'.
Regards
Raj