About
Pricing
Community
Teams
Start Free Trial
Log in
MJ
asked on
12/6/2013
Regex for Integer Equal to or greater than 100
Need a regex for integers equal to or greater than 100.
JavaScript
8
1
Last Comment
leakim971
8/22/2022 - Mon
kaufmed
12/6/2013
You can use:
^(1\d\d|\d{4,})$
Select all
Open in new window
MJ
12/6/2013
ASKER
Hi,
This doesn't work . try 999 or any number that doesn't start with a 1 and is 3 digits long.
kaufmed
12/6/2013
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,})$
Select all
Open in new window
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
kaufmed
12/6/2013
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
leakim971
12/6/2013
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!")
}
MJ
12/6/2013
ASKER
I have to use a regex. it is for a tool.
MJ
12/6/2013
ASKER
Thank you!
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
leakim971
12/6/2013
So why Javascript topic? Anyway, if you're happy, I'm happy... and I think kaufmed is happy too :)
Have a nice week-end!
Open in new window