I Want to Extract all URL's from HTML

  • Thread starter Thread starter CrimeMaster
  • Start date Start date
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.
 
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...
 
here is RegularExpression for u
new Regex("(?<=href *= *'?\"?)[^'\";>
]*",RegexOptions.IgnoreCase|RegexOptions.Compiled);
 
Back
Top