Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi,

 

I have html source code in file.txt. I want to read a keyword from it.

for example

 

html Source:

=======================

<base href="http://bytes.com/" /><!--[if IE]></base><![endif]--> <title>How to save and read very big Array Value to/from file in VB.NET? - Visual Basic .NET answers</title> <meta http-equiv="Content-/>

====================

I want to read the title from above html source from <title>How to save and read very big Array Value to/from file in VB.NET? - Visual Basic .NET answers</title>

and save it in another file.

 

plz if any one have any idea or any linkes will help me .... plz help me

  • 3 weeks later...
Posted

Look into system.text.regularexpressions.

 

Something like this would do it:

 

Dim r As New System.Text.RegularExpressions.Regex("<title>(.+?)</title>")
Dim m As System.Text.RegularExpressions.Match = r.Match(strText)
System.Windows.Forms.MessageBox.Show("Title is: " & m.Captures(0).Value)

 

Though note I've not tested.

 

Mark

Please check the Knowledge Base before you post.

"Computers are useless. They can only give you answers." - Pablo Picasso

The Code Net

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...