Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Help with an "Easy" regular expression

Avatar of hefterr
hefterrFlag for United States of America asked on
Web ServersRegular Expressions
12 Comments1 Solution340 ViewsLast Modified:
I am a newbie to REGEX but the web world seems to have problems with a simple REGEX:

I just need to validate an input string to make sure they all consist of integers ((characters 0,1,2,3,4,5,6,7,8,9).  No leading or traling spaces allowed either.  Any number of integers allowed.  You can also assume the input is not all spaces if that helps as I test for that first.

FYI.  I am using Coldfusion using the IsValid("regex",variable, etc)

I found on a Coldfusion site  that recommended : ^{0,1}[1-9]+[\d]*  - but it does not allow the string to begin with "0" and also allows for a leading space?

Your expertise is greatly appreciated.

Avatar of Harisha M G
Harisha M GFlag of India imageEngineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answers