how can I generate REGEX for value > 2900 -


how can generate regex value > 2900.00 used formula below seems not working

(^[2-9][0-9]{3}|[0-9]{5,})(\.[0-9]+)$ 

i think should work you

/^29\d{2}\.[0-9][1-9]|[3-9]\d{3}\.\d{2}|[1-9]\d{4,}\.\d{2}$/ 

explanation

4 digit >= 2900.01 — 29\d{2}\.[0-9][1-9]

or

4 digit >= 3000.00 — [3-9]\d{3}\.\d{2}

or

any 5+ digit — [1-9]\d{4,}\.\d{2}


personally, think these kinds of regexp kind of silly, though. can't parse , compare result numerically?


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -