用于在 [ ] 中包含特殊字符和字符的正则表达式
RegEx for Including special character and characters inside a [ ]
我要求在字段中允许使用特殊字符和某些其他字符。我正在使用这个正则表达式:
"[a-zA-Z][a-zA-Z0-9._\-]*[@][a-zA-Z0-9.\-]+[.][a-zA-Z]+[a-zA-Z]"
所以我需要添加 [at] 而不是 @ 还要添加 [.] insteat of .在我的电子邮件验证中
我试试这样
"[a-zA-Z][a-zA-Z0-9._\-]*[\[at]\][a-zA-Z0-9.\-]+[\[dot]\][a-zA-Z]+[a-zA-Z]"
但它不起作用,也不知道如何修复它。
这对我有用:
"[a-zA-Z][a-zA-Z0-9._\-]*\[at\][a-zA-Z0-9.\-]+\[dot\][a-zA-Z]+[a-zA-Z]"
我要求在字段中允许使用特殊字符和某些其他字符。我正在使用这个正则表达式:
"[a-zA-Z][a-zA-Z0-9._\-]*[@][a-zA-Z0-9.\-]+[.][a-zA-Z]+[a-zA-Z]"
所以我需要添加 [at] 而不是 @ 还要添加 [.] insteat of .在我的电子邮件验证中
我试试这样
"[a-zA-Z][a-zA-Z0-9._\-]*[\[at]\][a-zA-Z0-9.\-]+[\[dot]\][a-zA-Z]+[a-zA-Z]"
但它不起作用,也不知道如何修复它。
这对我有用:
"[a-zA-Z][a-zA-Z0-9._\-]*\[at\][a-zA-Z0-9.\-]+\[dot\][a-zA-Z]+[a-zA-Z]"