javascript - Regex to allow number greater than 0.5 -


hi i'm working on regex , want add conditional allow numbers greater 0.5 here regex

^(?![.0]*$)[0-9]+(?:\.[1-9]{1,2})?$ 

i want values between 0 , 0.5 don't match this.

regular expressions awesome, can hard read , maintain. feels scenario should parse string , compare value.

var num = parsefloat(input); if (num > 0.5)     ... 

Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -