How can I make a regular expression match upper and lower case?

后端 未结 2 715
无人及你
无人及你 2020-12-15 17:33

I don\'t really know much about regex at all, but if someone could help me change the following code to also allow for lowercase a-z, that would be great!

$(         


        
2条回答
  •  太阳男子
    2020-12-15 18:32

    /[A-Za-z]{3}([0-9]{1,4})?|[A-Za-z]{1,3}/
    

    [] denotes a character class and A-Z is a allowed range and means ABCDEFGHIJKLMNOPQRSTUVWXYZ. You can extend this easy by adding a-z

提交回复
热议问题