Solved

Regex to test if number is over 2048

Posted on 2014-02-10
2
207 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 34

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 84

Accepted Solution

by:
ozo earned 500 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
json with xmlhttprequesr 2 33
Where to begin studying? 5 64
Safari SVG Image Problem 1 19
Re-position the objects 7 49
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now