首页 > 解决方案 > HTML 模式验证 RegExp 在 chrome 中不起作用

问题描述

我在 Html 的模式属性中使用以下正则表达式来验证电子邮件。(type="email" 保留没有域扩展名的电子邮件)。

<input type="text" name="value" class="form-control" placeholder="Value" pattern="[-\w+.%]+@[\w-.]+\.[A-Za-z]{2,4}(?:,[-\w+.%]+@[\w-.]+\.[A-Za-z]{2,4}){0,4}"/>

但这在 chrome 中不起作用,但在 Internet Edge 浏览器中运行良好。谁能帮我解决这个问题?

标签: htmlregexgoogle-chrome

解决方案


推荐阅读