Simon Rumble

Navigation

Blog

JavaScript email address validation part 3

Continuing on my my odyssey to find a decent JavaScript regular expression for email address validation, I've come up with something I'm happy with.

I started with Rob Eberhardt's crack at it here, but added some more characters that are allowed in the first bit (before the @).

^([0-9a-zA-Z]([-.+':#;<>\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,})$

My test for it is here.

Your thoughts?

14 Jan 2008 11:47 [category: /geek] #