Dnia Fri, 10 Jun 2005 14:57:21 +0100, John Abel napisał(a):

> $testVar =~ s#/mail/.*$##g
> 
> The only way I can think of doing it, is:
> 
> mailPos = testVar.find( "mail" )
> remainder =  testVar[ :mailPos ]
> 
> Any ideas would be appreciated.  I'm iterating over a lot of entries, 
> and running these lines for each entry.

import re
testVar = re.compile(r'/mail/.*$').sub('', testVar) 

--
JZ
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to