yasiraq
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 3/8/2009
-
Status: offline
|
Convert JScript To VBScript
Sunday, March 08, 2009 4:04 PM
( permalink)
Hi there, Can you plz convert me the following JScript function into its equivalent VBScript. ----------------------------------------------------- function GetHTMLDocTitle(s) { //returns the text between the Title tags s = "" + s + ""; //this pattern returns the title of an html document. var re = /(\<TITLE\>)(\s*)(.+)(\s*)(\<\/TITLE\>)/i var arr = re.exec(s); return RegExp.$3; } -------------------------- Thanks
|
|
|
|
TNO
-
Total Posts
:
2094
- Scores: 36
-
Reward points
:
0
- Joined: 12/18/2004
- Location: Earth
-
Status: offline
|
RE: Convert JScript To VBScript
Monday, March 09, 2009 1:51 AM
( permalink)
The JScript regular expression is unnecessary, since this is server side you can just use the same COM object:
Function GetTitle(s)
Dim document : Set document = CreateObject("htmlfile")
document.write(s)
GetTitle = document.title
End Function
To iterate is human, to recurse divine. -- L. Peter Deutsch
|
|
|
|