[英]What does the input pattern value below mean?
I've found this input pattern value from this website .我从这个网站找到了这个输入模式值。
^[a-zA-Z0-9.?#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(:.\.[a-zA-Z0-9-]+)*$
But, I don't know what this means as I don't really understand this input pattern stuff.但是,我不知道这意味着什么,因为我并不真正理解这种输入模式的东西。 Thank you!!
谢谢!!
It is a Regular Expression used for validating an email address.它是用于验证 email 地址的正则表达式。 the
pattern
attribute is used to accept only the inputs that follow the mentioned pattern. pattern
属性用于仅接受遵循上述模式的输入。
Simply, to understand, the above Regular Expression accepts inputs of the form xxx@yyy.yyy Here, xxx should be anything between az or AZ or 0-9 or the mentioned symbols.简单来说,上面的正则表达式接受xxx@yyy.yyy形式的输入,这里的 xxx 应该是 az 或 AZ 或 0-9 或上述符号之间的任何值。 You can repeat the xxx any no.
您可以重复 xxx 任何不。 of times, like aabzz##.
次,例如 aabzz##。
after this, an @ symbol must be included.在此之后,必须包含一个 @ 符号。
Later, yyy could be anything, 1 or more times, among az or AZ or 0-9, followed by a dot (.).之后,yyy 可以是 az 或 AZ 或 0-9 之间的任何值,1 次或多次,后跟一个点 (.)。 After this dot, you should have atleast 1 character between az or AZ or 0-9
在这个点之后,你应该在 az 或 AZ 或 0-9 之间至少有 1 个字符
Note: in yyy Symbols are not allowed according to the regular expression.注意:在 yyy 符号是不允许根据正则表达式的。
If all these requirements meet, then your input is valid, otherwise, it is invalid.如果所有这些要求都满足,那么您的输入是有效的,否则,它是无效的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.