?
Solved

Regex to test if number is over 2048

Posted on 2014-02-10
2
Medium Priority
?
218 Views
Last Modified: 2014-02-10
Hi,
Not sure how to write a regex that tests if number (positive integer) is over 2048 (2049+)? It has to be a regex due to the tool I'm using.

Thanks!
0
Comment
Question by:894359
2 Comments
 
LVL 35

Expert Comment

by:Dan Craciun
ID: 39848589
Here's how to check if it's over 2000:
^([2-9]\d{3}|[1-9]\d{4,})$

HTH,
Dan
0
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 39848600
(2049|20[5-9]\d|2[1-9]\d\d|[3-9]\d\d\d|[1-9]\d\d\d\d)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question