Difference between regex [A-z] and [a-zA-Z]

后端 未结 6 1928
北海茫月
北海茫月 2020-11-22 08:39

I am using a regex to program an input validator for a text box where I only want alphabetical characters. I was wondering if [A-z] and [a-zA-Z] we

6条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 09:20

    Take a look at ASCII table. You'll see that there are some characters between Z and a, so you will match more than you intented to.

提交回复
热议问题