<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Dim objFile
Set objFile = objFSO.OpenTextFile(Server.MapPath("/demos/ExampleHTML.html"))
Dim strContents
strContents = objFile.ReadAll
objFile.Close
Set objFile = Nothing
Set objFSO = Nothing
Dim objRegExp
Set objRegExp = New RegExp
Dim strHTML, strMatch
strMatch = "<title>(.*?)<\/title>"
objRegExp.Pattern = strMatch
objRegExp.IgnoreCase = True
objRegExp.Global = True
Dim objMatches
Set objMatches = objRegExp.Execute(strContents)
If objMatches.Count > 0 then
Response.Write "The Web page title is: " & _
Mid(objMatches(0).Value, 8, Len(objMatches(0).Value) - 16)
Else
Response.Write "No TITLE tag found."
End If
Set objRegExp = Nothing
%>
|