MSSCHED sharing violation with VB-RegExp

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Fri Oct 17, 2003 10:57 pm

Thanks for the sample code. Can you also provide a sample of what is in temp-blasterquery.txt after writing to it?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

dfritz
Newbie
Posts: 4
Joined: Fri Oct 17, 2003 3:03 pm

Post by dfritz » Sat Oct 18, 2003 5:28 am

Not a problem. Glad to be of any help that I can. Surprisingly, the only time the temp-blasterquery.txt file changes for this app is during the original write. It is saved as follows (except longer)...



Real-time Traffic Query Results



Source Addresscount(Destination Address)
10.117.252.73275
10.216.150.129247
10.101.150.56161
10.213.151.31
10.216.150.131
10.216.230.671




With the find, I extract data like this...

10.117.252.73275

from the page (because I haven't figured out backreferences and group naming conventions in VBscript yet). I keep it as a variable and pass it to a RegEx.replace function to strip out the remaining HTML to end up with just the IP address and the count for anything over a count of 9. Since the RegEx.Replace works against a variable, it doesn't change the file.

I guess I need to do some more research to figure out how to get it to change the original HTML file. I didn't need it to write back to the file in my case so I hadn't tried that yet. I would guess that you could pull the whole file in as a variable as suggested earlier in this thread and treat it like I did my little extract then write it back to the HTML file.

I hope this helps.

Thanks,
Darren

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Sat Oct 18, 2003 5:17 pm

Just in case the problem is the RegEx expression, I just tested this RegEx in a text editor (TextPad), and it seems to be doing the task that you wanted. This should locate any left-aligned IP address in a table cell followed by a right aligned cell with a value of 10 or more.

Search for:
(([0-9]{1,3}.){3,3}[0-9]{1,3}[0-9]{2,})
Replace with:
\1
Explanation of Search string:
________=string segment
(_______________________=Start of first tagged expression (\1)
(_______________________=Start of second tagged expression (\2)
[0-9]{1,3}.______________=group of 1-3 digits followed by a period
)_______________________=End of second tagged expression (\2)
{3,3}___________________=min/max of previous expression (\2) (three sequences of [0-9]{1,3}.)
[0-9]{1,3}_______________=group of 1-3 digits
_____=string segment
[0-9]{2,}________________=group of at least 2 digits
)_______________________=End of first tagged expression (\1)
______________=string segment[/list]
Explanation of Replace string:
\1________________=([0-9]{1,3}.){3,3}[0-9]{1,3}[0-9]{2,}
I haven't tried it using your VB example yet. The code above is using POSIX format. Use the following SEARCH without POSIX format:
\(\([0-9]\{1,3\}.\)\{3,3\}[0-9]\{1,3\}[0-9]\{2,\}\)
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

dfritz
Newbie
Posts: 4
Joined: Fri Oct 17, 2003 3:03 pm

Post by dfritz » Mon Oct 20, 2003 3:29 am

Thanks Bob!

I will need to study that further. I am relatively new to RegEx and got most of my education so far from the PowerGrep tutorial which seems to lean towards the \d type of short cuts.

I tried the search again using both the POSIX and nonPOSIX alternatives that you presented and I still get the VBScript error only on the sample data line with the quote. I get all of the data back correctly and no errors on the other lines. So it may not be the regex. There may be something else in my code but I am not seeing it yet.

I am hoping that support can reproduce the problem and that it isn't just something flaky on my end. Thanks again for the info and support.

Thanks,
Darren

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts