Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
regexp implementation help (vbscript)
Old 08-13-2006, 03:56 PM regexp implementation help (vbscript)
Junior Talker

Posts: 3
Trades: 0
Okay, so ive got a regexp that works perfectly in an online tester. I am having trouble implementing in my existing code.

It takes a variable (xmlhttp.responseText) that holds an external page's source code, and checks it for the existance of a link to a specified domain. It should then show ONLY the HTML for that link, and then break it up in the sub strings.

What it DOES do currently, is return the whole string, EXCEPT the link it should, in effect doing the opposite.

Any help is appreciated. Source code i'm checking against to test is Robar's Pages v1.0 Home - The Personal Website of Gary Robar and looking for the link to billiardsforum.info.

The VB code thus far:

Code:
url = objRSanc("la_blt_link_url")

set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP")  
on error resume next 
xmlhttp.open "GET", url, false 
xmlhttp.send ""  
    
if err.number <> 0 then 
VerifyUrl=false
response.redirect("http://www.google.com/?0000000000000000000000")    
else 
    
set regizzo = New RegExp
regizzo.Pattern = "(<[^>]*?a[^>]*?(?:billiardsforum.info)[^>]*>)((?:.*?(?:<[ \r\t]*a[^>]*>?.*?(?:<.*?/.*?a.*?>)?)*)*)(<[^>]*?/[^>]*?a[^>]*?>)"

regizzo.Global = True
regizzo.IgnoreCase = True

dim stipulation 
    
stipulation = regizzo.replace(xmlhttp.responseText, "$2")
    
response.write stipulation     

    
Set regizzo = Nothing
    
dim updiz
Set updiz = Server.CreateObject("ADODB.Connection")
updiz.Open strdbee
Set objRSupd = Server.CreateObject("ADODB.RecordSet")

strsqlu = "UPDATE la_blt SET la_blt_link_anchor='somevar' WHERE la_blt_id =44"
objRSupd.Open strSQLu, updiz, adLockOptimistic
    
end if
    

response.write("done.")
%>
grobar is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-24-2006, 08:54 AM Re: regexp implementation help (vbscript)
saadatshah's Avatar
Extreme Talker

Posts: 215
Name: Syed Saadat Ali
Location: Lahore, Pakistan
Trades: 0
what error appears?
__________________
- -- --- ---- ----- ------ ------- ---------------
If you have knowledge, let others light their candles in it.
saadatshah is offline
Reply With Quote
View Public Profile Visit saadatshah's homepage!
 
Reply     « Reply to regexp implementation help (vbscript)
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09350 seconds with 12 queries