Convert JScript To VBScript

Author Message
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)
0
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
 
#1
    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)
    0
    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
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9