Home > front end >  O a validation range 1-7200 regular expression of positive integers
O a validation range 1-7200 regular expression of positive integers

Time:10-13

For regular great god taught a validation range 1-7200 positive integer regular expressions, the younger brother grateful

CodePudding user response:

I'm afraid that's got to be a regular, a regular plus an if

CodePudding user response:

I temporarily use show positive integers is regular and the if (val & gt; 0 & amp; & Val<=7200), regular should be able to do it, for a great god apparition ~

CodePudding user response:

refer to the second floor ragine response:
I temporarily use show positive integers is regular and the if (val & gt; 0 & amp; & Val<=7200), regular should be able to do it, a great god apparition ~

This can be accomplished with regular,
But with regular do too much trouble, is prone to errors, modify is not convenient, really not as good as using numerical comparative judgment,

CodePudding user response:

 
Must match in stages with regular words

[1-9] \ d {0, 2}//match 1-999
[1-6] \ d {3}//matching 1000-6999
7 [0, 1] \ d {2}//matching 7000-7199
7200//match 7200

Add up to is
^ (1-9] [\ d {0, 2} | [1-6] \ d {3} | 7 [0, 1] \ d {2} | 7200) $

CodePudding user response:

@ the waves of the sky thank you bosses give directions, I instructed the

CodePudding user response:

Regular is character format is a standard way of matching, does not contain numerical validation, such as the date format can be determined, but with regular date interval is very troublesome, numerical is also same, numerical interval number format is easy, very troublesome

In front of a signed count, the front have a zero padding, too much trouble

CodePudding user response:

^ (1-9] [\ d {0, 2} | \ d {3} [1-6] 7 [0, 1] \ | d {2} | 7200) $

CodePudding user response:

@ illiterate old gu uh-huh, thanks to big teacher, later have time or want to learn the regular,

CodePudding user response:

https://blog.csdn.net/weixin_44563573/article/details/101621332
  • Related