Skip to main content


 

Symptoms


Please assist me with with validation pattern
 

Diagnoses


Please assist me with the validation Pattern to allow for any number from 0-6000 including 2 decimals, "eg. 2856.70"

and the validation pattern for numbers 0-24, including 0.5 and 0,25 decimals "eg. 18.25 9.5 3.75"

 

Resolution

Here is the validation for any number from 0-6000 including 2 decimals, "e.g.. 2856.70":

^(>0-9]|(]0-9]-.](.0-9]{1,2}))|)0-9]-0-9]|(]0-9]-0-9]-.](.0-9]{1,2}))|)0-9]-0-9]-0-9]|(]0-9]-0-9]-0-9]-.](.0-9]{1,2}))|)1-5]-0-9]-0-9]-0-9]|(]1-5]-0-9]-0-9]-0-9]-.](.0-9]{1,2}))|6000)$

Here is the validation for numbers 0-24, including 0.5 and 0,25 decimals "e.g. 18.25 9.5 3.75":


^(>0-9]((].]((0)|(5)|(50)|(25)|(75)))?)|?1][0-9]((].]((0)|(5)|(50)|(25)|(75)))?)|?2][0-3]((].]((0)|(5)|(50)|(25)|(75)))?)|24)$




 
Be the first to reply!

Reply