Regex - With Space and Special Characters

后端 未结 5 1267
臣服心动
臣服心动 2020-12-22 02:49

I\'m using the following Regex ^[a-zA-Z0-9]\\s{2,20}$ for input

  • Letters A - Z
  • Letters a - z
  • Numbers 0 - 9

The inp

5条回答
  •  情歌与酒
    2020-12-22 03:01

    Try ^[a-zA-Z0-9 ]{2,20}$.

    And are you sure your original expression worked? The quantifier {2,20} is only applied to the \s, and not to your set inside [].

提交回复
热议问题