I'm experiencing a rather strange issue when i try to use the Regexp object in an ASP script; maybe i'm missing something. basically, i have a script which reads in the contents of a text file, looks for this string pattern "<!---start-->.*<!---end-->" and replaces it with the new employee name like this:
<!---begin-->NEW-EMPNAME<!---end-->. here's the code
'===========================================
Dim REObj
Set REObj = New RegExp
With REObj
.Pattern = "<!---start-->.*<!---end-->"
.IgnoreCase = true
.Global = true
End With
strdata = REObj.Replace(strdata,"<!---begin-->" & strnewemployee & "<!---end-->")
'===========================================
problem is, if the new emp name is something like "empname 2", the final output is coming out as "empname 2 2" (see the duplicate 2 at the end)
if the original data is "empname 2 2", then the script returns "empname 2 2 2". I cant quite see where the problem is. any help would be greatly appreciated
<!---begin-->NEW-EMPNAME<!---end-->. here's the code
'===========================================
Dim REObj
Set REObj = New RegExp
With REObj
.Pattern = "<!---start-->.*<!---end-->"
.IgnoreCase = true
.Global = true
End With
strdata = REObj.Replace(strdata,"<!---begin-->" & strnewemployee & "<!---end-->")
'===========================================
problem is, if the new emp name is something like "empname 2", the final output is coming out as "empname 2 2" (see the duplicate 2 at the end)
if the original data is "empname 2 2", then the script returns "empname 2 2 2". I cant quite see where the problem is. any help would be greatly appreciated