Home > front end >  Js regular expressions, genuflect is begged requirements: small digital dispensable, up to a decimal
Js regular expressions, genuflect is begged requirements: small digital dispensable, up to a decimal

Time:12-03

0.1 99.9 including integer

CodePudding user response:

\ [^ ^ 0] d? $| bai [^ du0] \ d? . \ d {1, 2} $0.0 |? [^ 0] $
From
https://zhidao.baidu.com/question/573521048.html

CodePudding user response:

reference 1st floor is a little small lewd honest reply:
^ \ [^ 0] d? $| bai [^ du0] \ d? . \ d {1, 2} $0.0 |? [^ 0] $
From
https://zhidao.baidu.com/question/573521048.html

11.0 99.9 can't match

CodePudding user response:

https://tool.oschina.net/regex/#
Try on the right have commonly used regular on it

CodePudding user response:

^ [1-9] \ d * \ \ d * \ | 0. [1-9] \ d \ d * * $

CodePudding user response:

 
^ (0. 1-9] [| \ [1-9] d? (\ \ d)? $

CodePudding user response:

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

CodePudding user response:

refer to the third floor is a little small lewd honest reply:

https://tool.oschina.net/regex/#Try on the right have commonly used regular here

good

CodePudding user response:

reference 5 floor sky waves reply:
 
^ (0. 1-9] [| \ [1-9] d? (\ \ d)? $

I can't 001 can get through it

CodePudding user response:

references from the 6th floor industry fire principle response:
^ (\ d +) (\. (\ d))? $

Also can pass 001

CodePudding user response:

refer to the eighth floor IT - the league of elite reply:
Quote: refer to fifth floor of the sky wave response:
 
^ (0. 1-9] [| \ [1-9] d? (\ \ d)? $

No 001 can

^ (0. \ [1-9] | \ [1-9] d? (\ \ d)? $

CodePudding user response:

Get so trouble
After the onblur to strong input values into a numerical value to judge the size, he wrote a few decimal point,
Check the front do is fault tolerance and the user experience, the mistakes of others changed not better for yourself, don't have to play a prompt box say you lose a space or non-numeric, or the more than dozen 0, is wrong,

CodePudding user response:

understand!