whoami? iam!

Erik Bågfors erik at bagfors.nu
Fri Dec 16 08:18:02 GMT 2005


fre 2005-12-16 klockan 10:12 +0200 skrev Bjorn Tillenius:
> On Fri, Dec 16, 2005 at 12:59:18AM -0600, Michael Ellerman wrote:
> > 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\.]+\>")
> 
> Well, for example, it won't match:
> 
>     "Foo.Bar" <foo at bar.com>
> 

Or "Erik Bågfors <erik at bagfors.nu>" :)

Just check the email-part and not the name-part.

/Erik





More information about the bazaar mailing list