Take the 2-minute tour ×

I am using following regex to match the range between 1 and 9999.9 and it works good!


But, I want the range to start from 0.5 through 9999.9!

How can I do this! Any suggestion!

share|improve this question
For God sake can you please enlighten me why to use regex for checking that number range? –  anubhava Oct 25 '12 at 13:51
"Any suggestion!" I would suggest not using a regular expression...! –  RB. Oct 25 '12 at 13:53
thwn whats ur suggestion to validate range? –  user1609085 Oct 25 '12 at 13:56
It depends what programming language you are using, but normally you would use a simple range test, e.g. value >= 0.5 && value <= 9999.9. –  RB. Oct 25 '12 at 13:58
right now, I am using the one u just suggested! but, it doesn't look good in code (for all my range validations, right now I have 120 lines of code)! –  user1609085 Oct 25 '12 at 14:03
show 1 more comment

1 Answer

up vote 1 down vote accepted

Easy, and you can also simplify the regex you already have:

share|improve this answer
add comment

Your Answer

