[A

This question already has an answer here:

  • Difference between regex [Az] and [a-zA-Z] 6 answers

  • Because

    [A-z0-9]+ 
     ↑ ↑ 
    

    is from A to z , see the ASCII table, ] appears between the two characters:

    在这里输入图像描述


    A===>64
    z===>122
    [===>91
    

    所以它在你定义的范围之间。使用[A-Za-z0-9]+


    您可以使用/[a-z0-9]+/ii使其不区分大小写)或/[A-Za-z0-9]+/

    链接地址: http://www.djcxy.com/p/86982.html

    上一篇: IP地址验证的正则表达式

    下一篇: [一个