js中邮箱的正则表达式
时间: 2023-10-08 16:08:53 浏览: 106
邮箱正则表达式
JS中邮箱的正则表达式可以使用以下表达式:
var emailReg = /^\w{6,18}@\w{2,4}\.(com)|(net)$/; [1]
这个正则表达式匹配的是由6到18位的字母、数字或下划线开头的邮箱名称,紧接着是一个@符号,然后是2到4位的字母、数字或下划线作为域名,最后以.com或.net结尾。 [1<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [JS常用的正则表达式(匹配邮箱、名字、手机号等等)](https://blog.csdn.net/Inmaturity_7/article/details/108204629)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [JS:关于邮箱的正则表达式及规则](https://blog.csdn.net/weixin_44136505/article/details/129860710)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文