Simple Regex Help

  • Thread starter Thread starter George Durzi
  • Start date Start date
G

George Durzi

This should be easy, but I'm having a hard time with it.

I need a regular expression to validate that a number entered is a decimal
(2 decimal placed) less than 1

Valid entries are:

0.54
0.5
..5
..54

Not Valid:
1.00
..999

Thank You!
 
Thanks Karl!
I came up with the less efficient (^0*.)(\d{1}|\d{2})$
Yours is cleaner. Thanks!
 

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

Back
Top