whoami? iam!

Harald Meland harald.meland at usit.uio.no
Fri Dec 16 13:55:51 GMT 2005


[Michael Ellerman]

> On Fri, 16 Dec 2005 00:27, Nathaniel McCallum wrote:
>> Thought this plugin (attached) may like to be included.
>>
>> Nathaniel
>
> It might be nice to try and validate the input, to catch typos more than 
> anything. I have a script which uses the following regexps to check email 
> addresses, although I didn't write it so I can't vouch for it's correctness - 
> but it looks ok to me.
>
> email_re = re.compile("[a-zA-Z0-9\.]+\@[a-zA-Z0-9\.]+")
> email_name_re = re.compile("(\w|\s)+\<[a-zA-Z0-9\.]+\@[a-zA-Z0-9\.]+\>")

You want email.Utils.parseaddr(), which is part of Python's standard
library.
-- 
Harald




More information about the bazaar mailing list