how to strip the domain name in python?

2007-04-13 Thread Marko . Cain . 23
Hi, I have a list of url names like this, and I am trying to strip out the domain name using the following code: http://www.cnn.com www.yahoo.com http://www.ebay.co.uk pattern = re.compile("http:(.*)\.(.*)", re.S) match = re.findall(pattern, line) if (match): s1, s2 = match[0]

Re: how to strip the domain name in python?

2007-04-13 Thread Alex Martelli
<[EMAIL PROTECTED]> wrote: > Hi, > > I have a list of url names like this, and I am trying to strip out the > domain name using the following code: > > http://www.cnn.com > www.yahoo.com > http://www.ebay.co.uk > > pattern = re.compile("http:(.*)\.(.*)", re.S) > match = re.findall(pattern,

Re: how to strip the domain name in python?

2007-04-13 Thread Michael Bentley
On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: > Hi, > > I have a list of url names like this, and I am trying to strip out the > domain name using the following code: > > http://www.cnn.com > www.yahoo.com > http://www.ebay.co.uk > > pattern = re.compile("http:(.*)\.(.*)", re.S) > ma

Re: how to strip the domain name in python?

2007-04-14 Thread Marko . Cain . 23
On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: > > > > > Hi, > > > I have a list of url names like this, and I am trying to strip out the > > domain name using the following code: > > >http://www.cnn.com > >www.yahoo.com > >h

Re: how to strip the domain name in python?

2007-04-15 Thread Marko . Cain . 23
On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: > On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> > wrote: > > > > > On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: > > > > Hi, > > > > I have a list of url names like this, and I am trying to strip out the > > > domain name using the f

Re: how to strip the domain name in python?

2007-04-15 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Marko.Cain.23 wrote: > On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: >> On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> >> wrote: >> >> >> >> > On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: >> >> > > Hi, >> >> > > I have a list of url names like this, and

Re: how to strip the domain name in python?

2007-04-15 Thread Steven Howe
[EMAIL PROTECTED] wrote: On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> wrote: On Apr 13, 2007, at 11:49 PM, [EMAIL PROTECTED] wrote: Hi,

Re: how to strip the domain name in python?

2007-04-15 Thread Marko . Cain . 23
On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Marko.Cain.23 > wrote: > > > > > On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: > >> On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> > >> wrote: > > >> > On Apr 13, 2007, at 11:49 PM, [EMAIL P

Re: how to strip the domain name in python?

2007-04-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, Marko.Cain.23 >> wrote: >> >> >> >>> On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: On Apr 14, 12:02 am, Michael Bentley <[EMAIL PROTECTED]> wrote: > On Apr 13

Re: how to strip the domain name in python?

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 4:24 PM, [EMAIL PROTECTED] wrote: > On Apr 15, 11:57 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> In <[EMAIL PROTECTED]>, >> Marko.Cain.23 >> wrote: >> >> >> >>> On Apr 14, 10:36 am, [EMAIL PROTECTED] wrote: On Apr 14, 12:02 am, Michael Bentley <[EMAIL PRO

Re: how to strip the domain name in python?

2007-04-15 Thread Michael Bentley
On Apr 15, 2007, at 7:57 PM, Michael Bentley wrote: > if net_location[0].lower() == 'www': > net_location = net_location[1:] It is not guaranteed that the host name will be 'www' though, is it? If you *really* want to strip the host portion of a domain name, I suppose you could m