Regular Expression - 4 digits in a row, but can't be all zeros

前端 未结 5 1809
北荒
北荒 2021-01-04 02:31

I am looking for a solution that can exclusively be done with a regular expression. I know this would be easy with variables, substrings, etc.

And I am looking fo

5条回答
  •  误落风尘
    2021-01-04 02:51

    Test for a sequence of 3 digits (0-9), then a 4th with only (1-9)

    /\d{3}[1-9]/
    

提交回复
热议问题