[Ncr-Python.in] get url from string

Tavish Naruka tavishnaruka at gmail.com
Mon Aug 1 19:16:46 CEST 2011


On Mon, Aug 1, 2011 at 10:32 PM, Narendra Sisodiya <
narendra at narendrasisodiya.com> wrote:

> Let
>
> STR = "Hello Website is http://google.com/ please visit"
>
> I need to extract url using python
> can anybody help ??
>
>
import re
a = "Hello Website is http://google.com/ please visit"
b=a.split(' ')
Re = re.compile("http://")
for x in b:
        m = Re.search(x)
        if m != None:
                print x

-- 
 Tavish Naruka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ncr-python.in/attachments/20110801/81b06a97/attachment.html>


More information about the Ncr-Python.in mailing list