From: "Shot (Piotr Szotkowski)" Date: 2009-09-25T00:35:37+09:00 Subject: Re: email regex --1yeeQ81UyVL57Vl7 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Sijo Kg: > I have a regular expression > /^([^.@\s,]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i > This exactly fits my need except for one. If your needs are checking email addresses=E2=80=99 validity, you really want to use something like=C2=B9 /^([a-zA-Z0-9&_?\/`!|#*$^%=3D~{}+'-]+|"([\x00-\x0C\x0E-\x21\x23-\x5B\x5D -\x7F]|\\[\x00-\x7F])*")(\.([a-zA-Z0-9&_?\/`!|#*$^%=3D~{}+'-]+|"([\x00-\ x0C\x0E-\x21\x23-\x5B\x5D-\x7F]|\\[\x00-\x7F])*"))*@([a-zA-Z0-9&_?\/`! |#*$^%=3D~{}+'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[\x00-\x7F])*\])(\. ([a-zA-Z0-9&_?\/`!|#*$^%=3D~{}+'-]+|\[([\x00-\x0C\x0E-\x5A\x5E-\x7F]|\\[ \x00-\x7F])*\]))*$/ =E2=80=A6as " spaces! @s! \"escaped quotes!\" "@yahoo.com is a perfectly valid email address. (Note that " spaces! @s! \"escaped quotes!\" "@=C5=82=C3=B3d=C5=BA.pl is also a perfectly valid email address which the above doesn=E2=80=99t mat= ch.) You might want to check =C2=B9 http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/173923= ?173909-178505 for the discussion on this. =E2=80=94 Shot --=20 anyone who finds the MS Office ribbon intuitive is not a member of the human species as I understand it [William Morgan] --1yeeQ81UyVL57Vl7 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkq7kcUACgkQi/mCfdEo8Uq4fwCgufsbg356ySjB2nB5jwk719DA +t4AoJmGdDL8usywgwPJnqW+nw3HwqV7 =YPEJ -----END PGP SIGNATURE----- --1yeeQ81UyVL57Vl7--