electricd7
asked on
Need to find the value between <tag> </tag> using VBscript
Hello,
I have using msxml to scrape the contents of a webpage into a variable (myvar). Now I want to use VBscript to store the string between 2 specific tags found in the source. The tags data I want is held between the following:
<div id="myscore">137475</div>
So I want to search the entire myvar variable and end up with a new variable that only holds the value "137475". Can somone write a function that does this? Seems like it would be fairly easy to do using InStr, but my brain is asleep this morning!
ED7
I have using msxml to scrape the contents of a webpage into a variable (myvar). Now I want to use VBscript to store the string between 2 specific tags found in the source. The tags data I want is held between the following:
<div id="myscore">137475</div>
So I want to search the entire myvar variable and end up with a new variable that only holds the value "137475". Can somone write a function that does this? Seems like it would be fairly easy to do using InStr, but my brain is asleep this morning!
ED7
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sorry, typo. Change:
to:
With RegEx
to:
With RegX
ASKER
Perfect, thanks!
electricd7,
Glad to help! If you have not already done so, I would really appreciate it if you could please return to my article
https://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html
and click 'Yes' for the 'Was this helpful?' voting.
Patrick
Glad to help! If you have not already done so, I would really appreciate it if you could please return to my article
https://www.experts-exchange.com/Programming/Languages/Visual_Basic/A_1336-Using-Regular-Expressions-in-Visual-Basic-for-Applications-and-Visual-Basic-6.html
and click 'Yes' for the 'Was this helpful?' voting.
Patrick
ASKER
Object required: 'RegEx'