Is the regular expression [a-Z] valid and if yes then is it the same as [a-zA-Z]?

前端 未结 7 1161
伪装坚强ぢ
伪装坚强ぢ 2020-11-27 07:53

Is the regular expression [a-Z] valid and if yes then is it the same as [a-zA-Z]? Please note that in [a-Z] the a is lowercase and the Z is uppercase.

E

相关标签:
7条回答
  • 2020-11-27 08:40

    No, a (97) is higher than Z (90). [a-Z] isn't a valid character class. However [A-z] wouldn't be equivalent either, but for a different reason. It would cover all the letters but would also include the characters between the uppercase and lowercase letters: [\]^_`.

    0 讨论(0)
提交回复
热议问题