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

后端 未结 6 1927
北海茫月
北海茫月 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条回答
  •  萌比男神i
    2020-11-22 09:23

    Take a look at the ASCII chart (which Java characters are based on): there are quite a few punctuation characters situated between Z and a, namely these:

    [\]^ _`
    

提交回复
热议问题