Does anyone know of a quick way of performing this:
$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
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
JZ wrote:
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
John Abel wrote:
Does anyone know of a quick way of performing this:
$testVar =~ s#/mail/.*$##g
Use the re (regular expression) module. Since you are iterating over a lot of
entries, it is good to compile the regular expression outside of the loop.
import re
mailRE =
I'd consider taking a look at the re module ;)
Andreas
On Fri, Jun 10, 2005 at 02:57:21PM +0100, John Abel wrote:
Does anyone know of a quick way of performing this:
$testVar =~ s#/mail/.*$##g
The only way I can think of doing it, is:
mailPos = testVar.find( mail )
remainder =