Issue
Already done regex for 0 to 50
^(?:[1-9]|[1-4][0-9]|50)$
its working fine. Now trying to write with negative numbers like regex only allow -130 to 30 without decimal points.
Solution
^(\-[1-9][0-9]?|\-1(0[0-9]|[12][0-9]|30)|[0-9]|[12][0-9]|30)$
\-[1-9][0-9]?
checks for -99 to -1\-1(0[0-9]|[12][0-9]|30)
checks for -130 to -100[0-9]|[12][0-9]|30
checks for 0 to 30
Answered By - dork
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.