Hope this is the mailing list

Alex alex at somewhere.round.here
Sat Jan 8 23:16:20 EST 2000


> how i can extract this four variable
> gecko
> jing at kirk.com
> toad
> ray at lex.com
> from this two
> "gecko" <jing at kirk.com>
> "toad" <ray at lex.com>
> by using regular expression????

Well, I guess this is using regular expressions somewhere:

>>> import rfc822
>>> b='''"gecko" <jing at kirk.com>
... "toad" <ray at lex.com>'''
>>> a=rfc822.AddressList(b)
>>> a.addresslist
[('gecko', 'jing at kirk.com'), ('toad', 'ray at lex.com')]
>>> reload(rfc822)
<module 'rfc822' from '/usr/lib/python1.5/rfc822.pyc'>
>>> 

If you look in rfc822.py (on my machine, it would be in
/usr/lib/python1.5/rfc822.py) then you can probably work it out.

Alex.



More information about the Python-list mailing list