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

后端 未结 11 815
夕颜
夕颜 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:31

    (?!^\d+$)^.+$
    

    This says lookahead for lines that do not contain all digits and match the entire line.

提交回复
热议问题