How to extract some text?

odeits odeits at gmail.com
Mon Mar 9 22:14:28 EDT 2009


On Mar 8, 3:50 pm, Oltmans <rolf.oltm... at gmail.com> wrote:
> On Mar 9, 3:37 am, Chris Rebert <c... at rebertia.com> wrote:
>
> > Learn about the methods of the string class (str):http://docs.python.org/library/stdtypes.html#id4
>
> > You'll probably be most interested in .split()
>
> OK, thanks I got it. I was trying to use Regex but .split() just
> worked like a charm. Thank you ;)
>
>
>
> > Cheers,
> > Chris
>
> > --
> > I have a blog:http://blog.rebertia.com
>
>

The regex you were lookingfor was probably something like p =
re.compile(r'href='(.*?)')

when you p.match(mystring)  group(1) will be your url



More information about the Python-list mailing list