473,503 Members | 1,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RegExp Replace Method causes Access Violation


Hi group,

I am using the VBScript RegExp object from an ASP-Page and
I got
the following debugger output, when calling the Replace()
method:

"First-chance exception at 0x77e97c5c in inetinfo.exe:
0xC0000005: Access
violation reading location 0x0000400c."

Otherwise the code is running fine. The result is correct
too.
But is it normal to have this exeption???
Or is there a bug in den VB component?!

Here is the code:

<%
Set objRegExp = New RegExp
strReplace= ""
strPattern = "[^\s\w]"
objRegExp.IgnoreCase = TRUE
objRegExp.Global = TRUE
strToReplace = "this-is-a-test."
objRegExp.Pattern = strPattern
strResult = objRegExp.Replace(strToReplace, strReplace)
Response.Write(strResult)
%>

Here are some system informations:

W2K (5.00.2195 Service Pack 3)
Internet Information Server 5
vbscript.dll (Version 5.6.0.7426)

Thanks,
Alex
Jul 19 '05 #1
7 4441
"strReplace= "" "

^^Your replacing nothing

Assuming the ASP replace function is the same as the VB one, it should be;

strResult = Replace(Expression, strToReplace, strReplace)

Where expression is the string itself. E.g. if you wanted to replace

"I went to the park today"

With

"I went to the park yesterday"

It would be

strResult = Replace("I went to the park today", "today", "yesterday")

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Alex <ka*******@eurobase.lu> wrote in message
news:0a****************************@phx.gbl...

Hi group,

I am using the VBScript RegExp object from an ASP-Page and
I got
the following debugger output, when calling the Replace()
method:

"First-chance exception at 0x77e97c5c in inetinfo.exe:
0xC0000005: Access
violation reading location 0x0000400c."

Otherwise the code is running fine. The result is correct
too.
But is it normal to have this exeption???
Or is there a bug in den VB component?!

Here is the code:

<%
Set objRegExp = New RegExp
strReplace= ""
strPattern = "[^\s\w]"
objRegExp.IgnoreCase = TRUE
objRegExp.Global = TRUE
strToReplace = "this-is-a-test."
objRegExp.Pattern = strPattern
strResult = objRegExp.Replace(strToReplace, strReplace)
Response.Write(strResult)
%>

Here are some system informations:

W2K (5.00.2195 Service Pack 3)
Internet Information Server 5
vbscript.dll (Version 5.6.0.7426)

Thanks,
Alex

Jul 19 '05 #2
"Steven Burn" <nobody@PVT_it-mate.co.uk> wrote in message
news:u7**************@TK2MSFTNGP09.phx.gbl...
"strReplace= "" "

^^Your replacing nothing

Assuming the ASP replace function is the same as the VB one, it should be;
strResult = Replace(Expression, strToReplace, strReplace)

Where expression is the string itself. E.g. if you wanted to replace

"I went to the park today"

With

"I went to the park yesterday"

It would be

strResult = Replace("I went to the park today", "today", "yesterday")

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Alex <ka*******@eurobase.lu> wrote in message
news:0a****************************@phx.gbl...


You are wrong, but that's for participating. ;-p
The OP is using the Replace method of the RegExp object, not the
VBScript Replace function.

HTH
-Chris Hohmann
Jul 19 '05 #3
"Alex" <ka*******@eurobase.lu> wrote in message
news:0a****************************@phx.gbl...

Hi group,

I am using the VBScript RegExp object from an ASP-Page and
I got
the following debugger output, when calling the Replace()
method:

"First-chance exception at 0x77e97c5c in inetinfo.exe:
0xC0000005: Access
violation reading location 0x0000400c."

Otherwise the code is running fine. The result is correct
too.
But is it normal to have this exeption???
Or is there a bug in den VB component?!


Most likely component related. Here's a link:

www.aspfaq.com/2355

HTH
-Chris Hohmann
Jul 19 '05 #4
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You are wrong, but that's for participating. ;-p


That should read, "thanks for participating..."
Jul 19 '05 #5
hehe, after the day I am having, I kinda figured I would be (had an
extremely bad fortnight cause of my cr_ppy ISP and doesn't look like it's
gonna get better any time soon)

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)

Chris Hohmann <no****@thankyou.com> wrote in message
news:Of**************@TK2MSFTNGP12.phx.gbl...
"Chris Hohmann" <no****@thankyou.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
You are wrong, but that's for participating. ;-p


That should read, "thanks for participating..."

Jul 19 '05 #6
Hi Alex,

I also can't reproduce the problem yet. From the error, it seems to be a
install or configration issue, for example, corrupted installtion for
RegExp. You may try to execute a VBS file with similar code on the computer
to confirm this.

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #7
Thanks all for the participation!
I solved the problem in installing the newest vbscript.dll
(version 5.6.0.8515)

Alex
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
3507
by: RobG | last post by:
I'm messing with getPropertyValue (Mozilla et al) and currentStyle (IE) and have a general function (slightly modified from one originally posted by Steve van Dongen) for getting style properties:...
11
4446
by: athos | last post by:
Hi guys, Sounds a bit strange, however, if we could put some calculation in stored procedure it would be quite convenient, just... where can I find a REGEXP library for matching checking?...
4
7446
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
2
1466
by: Bill McCormick | last post by:
Hello, I'm new to VB.NET but have used regexp in Perl and VI. I'd like to read a regular expression from a file and apply it to a string read from another file. The regexp is simple word...
7
1892
by: arno | last post by:
Hi, I want to search a substring within a string : fonction (str, substr) { if (str.search(substr) != -1) { // do something } }
6
2255
by: runsun pan | last post by:
Hi I am wondering why I couldn't get what I want in the following 3 cases of re: (A) var p=/(+-?+):(+)/g p.exec("style='font-size:12'") -- // expected
10
2328
by: Markus Svilans | last post by:
Hi, I have a weird problem in a virtual method. The original method code raises an access violation when it is run. The solution to the problem is to declare a dummy integer inside the virtual...
5
1265
by: yoni | last post by:
Hi, I am trying to write a regexp to find all the code on the header of entities in SQL Server (views, SPs, etc...) I got something like this: (.|\n)*((create view)|(create proc)|(create...
3
1444
by: yoni | last post by:
Hi, I am trying to write a regexp to find all the code on the header of entities in SQL Server (views, SPs, etc...) I got something like this: (.|\n)*((create view)|(create proc)|(create...
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
382
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.