• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 573
  • Last Modified:

RegEx decimal validation

Hi,

How can I validate the following format using Regular expression validator?

any decimal value > max 100.

Please help.

ayha
0
ayha1999
Asked:
ayha1999
4 Solutions
 
GaryCommented:
([0-9.-]{1,10}|100)
0
 
guru_samiCommented:
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
käµfm³d 👽Commented:
This should work for 0 - 100:

^(?:100(?:\.0+)?|\d{2}(?:\.\d+)?|0?\d(?:\.\d+)?)$

Open in new window

0
 
ayha1999Author Commented:
Thanks
0
 
käµfm³d 👽Commented:
I feel the need to point out that GaryC123's suggestion considers entries such as the following to be valid input:

..........
-.-.-.-.
----

Open in new window

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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now