Solved

Regex for Integer Equal to or greater than 100

Posted on 2013-12-06
8
2,065 Views
Last Modified: 2013-12-06
Need a regex for integers equal to or greater than 100.
0
Comment
Question by:894359
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39702545
You can use:

^(1\d\d|\d{4,})$

Open in new window

0
 

Author Comment

by:894359
ID: 39702557
Hi,
This doesn't work . try 999 or any number that doesn't start with a 1 and is 3 digits long.
0
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39702563
My apologies. I was writing that on the way out of the door of the office. Corrected:

^([1-9]\d\d|[1-9]\d{3,})$

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 75

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 39702566
Shorter version:

^[1-9]\d\d\d*$

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
ID: 39702585
Why a regex?

if( i * 1 >= 100 ) { // in term of performance it's faster than a regex !
   alert("your integer is equal to or greater than 100!")
}
0
 

Author Comment

by:894359
ID: 39702606
I have to use a regex. it is for a tool.
0
 

Author Closing Comment

by:894359
ID: 39702608
Thank you!
0
 
LVL 82

Expert Comment

by:leakim971
ID: 39702624
So why Javascript topic? Anyway, if you're happy, I'm happy... and I think kaufmed is happy too :)

Have a nice week-end!
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
This article discusses how to implement server side field validation and display customized error messages to the client.
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

635 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