Solved

Regex for Integer Equal to or greater than 100

Posted on 2013-12-06
8
1,913 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
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!

 
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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
I'm a Human captcha checkbox 13 39
Adding 1 the value of input "text" every 3 seconds 5 33
Getting selected value using Jquery 3 20
Jquery if else not working ... WHY? 5 24
Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
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…

756 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