Why is this regex allowing a caret?

前端 未结 3 1844
鱼传尺愫
鱼传尺愫 2020-11-21 05:34

http://regexr.com/3ars8

^(?=.*[0-9])(?=.*[A-z])[0-9A-z-]{17}$

Should match \"17 alphanumeric chars, hyphens allowed too, must include at le

3条回答
  •  臣服心动
    2020-11-21 06:24

    regex uses ASCII printable characters from the space to the tilde range.

    Whenever we use [A-z] token it matches the following table highlighted characters. If we use [ -~] token it matches starting from SPACE to tilde.

提交回复
热议问题