ASP Regex problem
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 ".*" and replaces it with the new employee name like this:
NEW-EMPNAME. here's the code
'===========================================
Dim REObj
Set REObj = New RegExp
With REObj
.Pattern = ".*"
.IgnoreCase = true
.Global = false
End With
strdata = REObj.Replace(strdata,"" & strnewemployee & "")
'===========================================
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
|