Regular expression allow zero so long as it is not the first digit [duplicate]
问题 This question already has answers here : Regular Expression allow null or 1 to 9 digit (3 answers) Closed 3 years ago . Yesterday I was posting one question here Regular Expression allow null or 1 to 9 digit This was working fine after that I saw in my quantity field not taking 10, 100, 1002 etc. value. because these values also present 0(zero) digit. So Please help me. 回答1: If you want null or a number that starts from [1-9] but can contain [0-9] , the pattern is (^[1-9][0-9]*$)|(^$) please,