I Want to Extract all URL's from HTML

C

CrimeMaster

Hi
i have stored the html of a web page into a string.And i want to
extract all the URL's and want to store them into an array of string.
plz help me if some body had write this Function pls send me the code i
will be thank full to u.

CreimeMaster.
 
L

Larry Lard

CrimeMaster said:
Hi
i have stored the html of a web page into a string.And i want to
extract all the URL's and want to store them into an array of string.
plz help me if some body had write this Function pls send me the code i
will be thank full to u.

Personally I'd use HtmlAgilityPack to parse the html into a DOM then
query that for <a> elements. But no doubt someone is even now preparing
a five line regex that will work nearly all the time...
 
G

Guest

here is RegularExpression for u
new Regex("(?<=href *= *'?\"?)[^'\";>
]*",RegexOptions.IgnoreCase|RegexOptions.Compiled);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top