Title |
Test
Find
Number Validation
|
Expression |
(?!^([0-9]+[-]?[0-9]+)$)(?!^([0-9]+[[\\s]*]?[0-9]+)$)^([0-9]+\.?[0-9]+$|(^[-]?[0-9]+([[\\s]*]?)$)|^([-]?)[0-9]+\.?[0-9]+([[\\s]*]?)|([0-9]+))$ |
Description |
I have worked on this regular expression to get valid numbers from users. Its really simple, but yes required alot of my time and attention to make it work perfectly. It was my very first creation of regular expression. |
Matches |
-3, -3.3, 3, 3.3 |
Non-Matches |
3. , 3. 3, -, -., spaces |
Author |
Rating:
Not yet rated.
Saqib Rasheed
|
Source |
|
Your Rating |
|
Title: God
Name: Yury
Date: 4/28/2007 9:53:42 AM
Comment:
Should be simpler way.