Hi,am trying to search and extract the text

href="http://www.yahoo.com"

from a string
<a href="http://www.yahoo.com" id="link1">.Here is my code:

import re

p=re.compile(r'\b(href="(.*)"){1}\b')
m=p.search('<a href="live.net" link="go2">')
print m.group()

#Prints: href="live.net" link="

The code above

Prints: href="live.net" link="

,but i want to the href="live.net"
I need help on this please

p = re.compile(r'(href="(.*?)")')

will do the trick

You should use "*?" instead of "*" : * will take the longest string that match the pattern while *? will take the shortest.
p=re.compile(r'\b(href="(.*?)"){1}\b')