gpt4 book ai didi

javascript - 正则表达式和 Javascript 模式构建

转载 作者:行者123 更新时间:2023-12-02 18:21:22 24 4
gpt4 key购买 nike

我真的需要帮助来构建此模式 XXX@XXX.XXX 的正则表达式

Starts with at least 3 char not @
then @ (only one)
at least 3 char that are not . or @
and than one .
than 3 char that are not . or @

这是我玩的但它不起作用

/^([a-zA-Z0-9._-]{3,})\.@([a-zA-Z0-9.-]{3,*})\.[a-zA-Z]{3,*}$/

最佳答案

^[^@]{3,}@[^@\.]{3,}\.[^@\.]{3}$

这是您正在寻找的正则表达式。但如果您想验证电子邮件地址,请不要使用此正则表达式。

关于javascript - 正则表达式和 Javascript 模式构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18794171/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com