1

I am new to regexes. I need help.

My HTML source is

<a  href="http://www.google.com"></a>
<img src ="planets.gif" width="145" height="126" alt="Planets" usemap ="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" href="http://www.sun.htm" alt="Sun">
<area shape="circle" coords="90,58,3" href="http://www.mercur.htm" alt="Mercury">
<area shape="circle" coords="124,58,8" href="http://www.www.venus.htm" alt="Venus">
</map>

I’m trying to extract all href links out like http://www.google.com. kindly help.

My Regex is

"href=[\\\"\\'](http:\\/\\/|\\.\\/|\\/)?\\w+(\\.\\w+)*(\\/\\w+(\\.\\w+)?)*(\\/|\\?\\w*=\\w*(&\\w*=\\w*)*)?[\\\"\\']"

it wil extract like href="http://www.google.com"

But I need only link http://www.google.com without href=

1
  • 1
    please put the html source in the code tags so we can see it! Commented May 24, 2013 at 8:57

1 Answer 1

1

Please use a XML-parser for this kind of stuff.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.