#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    1
    Rep Power
    0

    Unhappy Extract a URL from a string


    I am trying find a way to extract a url from <a href="url">. I was thinking of using String.matches(regex), but I don't kow what to set as the regex. Any Ideas?
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    I know for a fact that the php forum has some regex/url posts in it, cause I have replied to more than one myself. Do a search and you should find some regular expressions that can extract a url from a link tag.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    St. Louis, MO USA
    Posts
    43
    Rep Power
    12
    why not load the A element as a Node using the xml library of choice? I recommend dom4j, it is certainly the fastest.dom4j
    - Chris of Custom Fit Technology
    http://www.customfittech.com

    Access to MySQL Conversion Tool,
    Visual XSLT Conversion Tool

IMN logo majestic logo threadwatch logo seochat tools logo