Board index » Visual Studio » Visual Basic 6: RegExp replace generate error in vbscript.dll

Visual Basic 6: RegExp replace generate error in vbscript.dll

Visual Studio274
Hi.

I have created a simple application with a Form and a Button1 with this

piece of code:



Private Sub Command1_Click()

Dim sIn As String

Dim sOut As String

Dim re As RegExp



sIn = "TryMe"

Set re = New RegExp

With re

.Pattern = "[e]+$"

.IgnoreCase = True

.Global = True

End With

sOut = re.Replace(sIn, "")

MsgBox sOut

End Sub



Here, i am using a RegExp to remove from SIn all 'a' character starting from

the end of the string

Compiled, runned, all is OK.



I copy my exe to another PC but the instruction sOut = re.Replace(sIn, "")

generate an error in vbscript.dll!



I check the versions: my PC has version 5.6.0.8820, and the PC where I get

the error i have the version 5.6.0.6626.



I try to replace the file in C:\Windows\System32, but Windows XP restore its

own version!



What can I do?

It seem so strange to me that such a simple RegExp generate this error!



Thanks all.



Skysurfer


-
 

Re:Visual Basic 6: RegExp replace generate error in vbscript.dll

uhmm... but this is a vbSCRIPT group. did you not notice that?







"Skysurfer" <skysurfer72TOGLIMI@libero.it>wrote in message

Quote
Hi.

I have created a simple application with a Form and a Button1 with this

piece of code:



Private Sub Command1_Click()

Dim sIn As String

Dim sOut As String

Dim re As RegExp



sIn = "TryMe"

Set re = New RegExp

With re

.Pattern = "[e]+$"

.IgnoreCase = True

.Global = True

End With

sOut = re.Replace(sIn, "")

MsgBox sOut

End Sub



Here, i am using a RegExp to remove from SIn all 'a' character starting

from the end of the string

Compiled, runned, all is OK.



I copy my exe to another PC but the instruction sOut = re.Replace(sIn, "")

generate an error in vbscript.dll!



I check the versions: my PC has version 5.6.0.8820, and the PC where I get

the error i have the version 5.6.0.6626.



I try to replace the file in C:\Windows\System32, but Windows XP restore

its own version!



What can I do?

It seem so strange to me that such a simple RegExp generate this error!



Thanks all.



Skysurfer









-