regular expression

J

JB

Please can anybody help me with this.

I have a form that reads the numbers of team members. The numbers logic
is that it is 1 to 3 digits long. The first and the last digit can not be 0.

I don't get a regelar expression to work.

Examples
0 does not match
1 matches (as do the digits 1 to 9)
12 matches
01 or 10 don't match.
101 matches
001 does not match
110 does not match.

I tried combination of
[0-9]{1,3} with ^[1-9] and [1-9]$
It looks like I need a logical AND

Input is 3 digits AND the first digit is not 0 AND the last digit is not 0.

Any help is appreciated,

John
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top