Regex: How to match a string that is not only numbers

后端 未结 11 828
夕颜
夕颜 2020-11-30 03:18

Is it possible to write a regular expression that matches all strings that does not only contain numbers? If we have these strings:

  • abc
11条回答
  •  难免孤独
    2020-11-30 03:41

    if you are trying to match worlds that have at least one letter but they are formed by numbers and letters (or just letters), this is what I have used:

    (\d*[a-zA-Z]+\d*)+
    

提交回复
热议问题