String Regex problem

djw dwelch91.nospam at comcast.net
Mon Nov 24 22:18:35 EST 2003


Fazer wrote:
> Hello,
> 
> I have a string which has a url (Begins with a http://) somewhere in
> it.  I want to detect such a url and just spit out the url.  Since I
> am very poor in regex, can someone show me how to do it using a few
> examples?
> 
> Thanks a lot!

I would look here to improve your re-ex skills:

http://www.amk.ca/python/howto/regex/

Also, I find Kodos to be invaluable in developing and debugging regexs. 
Highly recommended.

http://kodos.sourceforge.net

Of course, you could just use urlparse in the standard library...

Good luck,

Don







More information about the Python-list mailing list