我对电子邮件验证正则表达式规则如下焦炭类过早结束
的电子邮件地址的本地部分可以使用这些ASCII字符的:
Uppercase and lowercase English letters (a-z, A-Z)
Digits 0 to 9
Characters ! # $ % & ' * + -/= ?^_ ` { | } ~
Character . (dot, period, full stop) provided that it is not the first or last character, and provided also that it does not appear two or more times consecutively.
/^(([^<>()[\]\\.,;:\[email protected]\"]+(\.[^<>()[\]\\.,;:\[email protected]\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i
这是在Javascript中工作,但在Ruby http://rubular.com/中,它给出错误“字符类的提前结束”。
我该如何解决这个问题?
你怎么把这些小箭头在你的正则表达式的顶部? – aelor
@aelor在[第3个键盘级别](http://en.wikipedia.org/wiki/AltGr_key)或/和[撰写密钥](http://en.wikipedia.org/wiki/Compose_Key)中。 – mudasobwa