我需要一个正则表达式的电子邮件地址和小写字母只。有人能帮助一个新手吗?我尝试了一些regex编辑器,但只是没有得到它的工作。
Example input: John@test.org (not allowed) JOHN@test.com (not allowed) john-test.com (not allowed) john@test.com (allowed) john@test.org (allowed)
bvuwiixz1#
this应该可以正常工作:
^[a-z]+\@[^\s]+\.[^\s]+$
s5a0g9ez2#
正则表达式:^[a-z]+\@[^\s]+\.[^\s]+$转换为Javascript:/^[a-z]+\@[^\s]+\.[^\s]+$/g转换为Python:r"^[a-z]+\@[^\s]+\.[^\s]+$"转换为Ruby:/^[a-z]+\@[^\s]+\.[^\s]+$/
/^[a-z]+\@[^\s]+\.[^\s]+$/g
r"^[a-z]+\@[^\s]+\.[^\s]+$"
/^[a-z]+\@[^\s]+\.[^\s]+$/
2条答案
按热度按时间bvuwiixz1#
this应该可以正常工作:
s5a0g9ez2#
正则表达式:
^[a-z]+\@[^\s]+\.[^\s]+$
转换为Javascript:
/^[a-z]+\@[^\s]+\.[^\s]+$/g
转换为Python:
r"^[a-z]+\@[^\s]+\.[^\s]+$"
转换为Ruby:
/^[a-z]+\@[^\s]+\.[^\s]+$/