Regex for Integer Equal to or greater than 100

Need a regex for integers equal to or greater than 100.
894359Asked:
Who is Participating?
 
käµfm³d 👽Connect With a Mentor Commented:
Shorter version:

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

Open in new window

0
 
käµfm³d 👽Commented:
You can use:

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

Open in new window

0
 
894359Author Commented:
Hi,
This doesn't work . try 999 or any number that doesn't start with a 1 and is 3 digits long.
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
käµfm³d 👽Commented:
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
 
leakim971PluritechnicianCommented:
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
 
894359Author Commented:
I have to use a regex. it is for a tool.
0
 
894359Author Commented:
Thank you!
0
 
leakim971PluritechnicianCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.