Welcome, Guest
  • Author Topic: How to fetch the url?  (Read 950 times)

    mirzahat

    • Jr. Programmer
    • **
    • Posts: 88
      • View Profile
      • Email
    How to fetch the url?
    « on: 05/18/07, 02:04 »
    Hello,
    I have this string:

    </table><div id=res> <table cellpadding=0 cellspacing=0 border=0 style="margin-top:1em"><tr><td><font size=-1>Tip: Save time by hitting the return key instead of clicking on "search"</font></td></tr></table><div><div class=g><h2 class=r><a href="http://en.wiktionary.org/wiki/Appendix:Persian_given_names" class=l>Appendix:Persian given names - Wiktionary</a></h2><table border=0 cellpadding=0 cellspacing=0><tr><td class="j"><font size=-1><b>...</b> Kurosh, Korosh; Mahdi; Maahir; Mahyar; Mani; Manoochehr; Mazdak; Maziyar; Mahrban; Mahran; Mahrdad; Mahrshad; Maysam; Milad; <b>Mirza</b>; Nakisa; Niyaz; Umid <b>...</b><br><span class=a>en.wiktionary.org/wiki/Appendix:Persian_given_names - 86k - </span>

    I need only this url from this string: http://en.wiktionary.org/wiki/Appendix:Persian_given_names

    it can be any other url inside, like http://somesite.com/index.html but the point is that I need to fetch the url exactly from this link. this string is in fact much longer, its a google result page html, so it is much longer, but you get the point.

    I think this can be done via Regular Expressions, but how?

    Regards,
    Mirza
    « Last Edit: 05/18/07, 02:08 by mirzahat »