Chhxin
V2EX  ›  问与答

大佬们, js 正则表达式求助,秃然啊!

  •  
  •   Chhxin · Jan 16, 2020 · 1928 views
    This topic created in 2336 days ago, the information mentioned may be changed or developed.

    长度 2-64 个字符,允许使用(.)分割字符成多段,每段允许大小写字母、数字或连字符(-),但不能连续使用(.)和(-)。不能以(-)和(.)开头结尾。

    本渣渣给大佬们跪了!!!

    2 replies    2020-01-19 09:49:29 +08:00
    Zoro76
        1
    Zoro76  
       Jan 16, 2020
    /^[^.-]((?![.-]{2,})[\w.-]){2,60}[^.-]$/
    Chhxin
        2
    Chhxin  
    OP
       Jan 19, 2020
    @Zoro76 非常感谢,给大佬跪了!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   925 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 20:28 · PVG 04:28 · LAX 13:28 · JFK 16:28
    ♥ Do have faith in what you're doing.