Reg Expression - 有效的国际电子邮件地址? [英] Reg Expression - valid International email addresses?
问题描述
任何人都可以帮我正常表达
来测试有效的国际电子邮件地址吗?
此外,还需要哪个版本的javascript(1.2?) ?
谢谢。
问候。
nagual写道:
任何人都可以帮我正式表达
来测试有效的国际电子邮件地址吗?
是的,我知道这说Perl,而不是JavaScript。但无论如何要读它。好吗?
http://www.perldoc.com/perl5.8.0/pod...-mail-address-
-
David Dorward http://david.us -lot.org/
重新设计正在进行中: http: //stone.thecoreworlds.net/
微软宣布IE已死(所以升级):
http://minutillo.com/steve/weblog/20...ces-ie-is-死了
以下使用改编自Jeffery Friedl的
书的正则表达式来检查电子邮件字符串的格式。
rxEmail =
/^\w [ - .\w]*\@[-a-b0-9] +(?:\。[ - a-b0-9] +)* \。(?:com | edu | biz | org | gov | int | inf
o | mil | net | name | museum | coop | aero | [az] [az])\ b /;
测试前转换为小写。
rxEmail.test(email.toLowerCase());
请注意,模式使用了非捕获括号,可用于IE5.5 +中的
和JavaScript 1.5。对于像NN4这样的旧浏览器替换(?:by
(在上面的表达式中。
***通过Developersdex发送 http://www.developersdex.com ***
不要只是参加USENET ...奖励它!
2003年7月12日16:27:45 GMT,Mark Szlazak< an ******* @ devdex.com>
写道:
以下使用改编自Jeffery Friedl's
的正则表达式来检查电子邮件字符串的格式。
rxEmail =
/^\w[-.\w]*\@[-a-b0-9]+(?:\.[-a-b0-9]+) * \。(?:com | edu | biz | org | gov | int | inf
o | mil | net | name | museum | coop | aero | [az] [az])\ b /;
在测试前转换为小写。
rxEmail.test(email.toLowerCase());
请注意,该模式使用非捕获在IE5.5 +和JavaScript 1.5中可用的括号。对于旧浏览器喜欢e NN4替换(?:by
(在上面的表达式中。
我的电子邮件地址中有一个+,你好像不列出那一个
以上...
吉姆。
-
comp.lang。 javascript常见问题 - http://jibbering.com/faq/
Can anyone please help me with a regular expression
to test for Valid International Email Addresses?
Also, which version of javascript (1.2 ?) is needed for same?
Thanks.
Regards.
nagual wrote:
Can anyone please help me with a regular expression
to test for Valid International Email Addresses?
Yes, I know this says "Perl", not "JavaScript" but read it anyway. OK?
http://www.perldoc.com/perl5.8.0/pod...-mail-address-
--
David Dorward http://david.us-lot.org/
Redesign in progress: http://stone.thecoreworlds.net/
Microsoft announces IE is dead (so upgrade):
http://minutillo.com/steve/weblog/20...ces-ie-is-dead
The following uses regular expressions adapted from Jeffery Friedl''s
book to check the format of an email string.
rxEmail =
/^\w[-.\w]*\@[-a-b0-9]+(?:\.[-a-b0-9]+)*\.(?:com|edu|biz|org|gov|int|inf
o|mil|net|name|museum|coop|aero|[a-z][a-z])\b/;
Convert to lower case before testing.
rxEmail.test(email.toLowerCase());
Note that the pattern used non-capture parenthesis which are available
in IE5.5+ and JavaScript 1.5. For older browsers like NN4 replace (?: by
( in the above expression.
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!
On 12 Jul 2003 16:27:45 GMT, Mark Szlazak <an*******@devdex.com>
wrote:
The following uses regular expressions adapted from Jeffery Friedl''s
book to check the format of an email string.
rxEmail =
/^\w[-.\w]*\@[-a-b0-9]+(?:\.[-a-b0-9]+)*\.(?:com|edu|biz|org|gov|int|inf
o|mil|net|name|museum|coop|aero|[a-z][a-z])\b/;
Convert to lower case before testing.
rxEmail.test(email.toLowerCase());
Note that the pattern used non-capture parenthesis which are available
in IE5.5+ and JavaScript 1.5. For older browsers like NN4 replace (?: by
( in the above expression.
My email address has a + in it, you don''t seem to list that one
above...
Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/
这篇关于Reg Expression - 有效的国际电子邮件地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!