5 May
2004
5 May
'04
3:44 p.m.
first last <flast@domain.com>
How can I extract all of the text up to but not including the < and assign to a new variable?
You should use parseaddr from the excellent email library see: http://docs.python.org/lib/module-email.Utils.html The advantage of using the utility rather than slicing the string yourself is that there's always a case with email that you haven't thought about. If you're using an older Python you may need to download the email library from http://www.python.org/sigs/email-sig/ A -- Logical Progression Ltd, 20 Forth Street, Edinburgh EH1 3LH, UK Tel: +44 (0)131 550 3733 Web: http://www.logicalprogression.net/