Title |
Test
Find
Pattern Title
|
Expression |
^[-]?([1-9]{1}[0-9]{0,}(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|\.[0-9]{1,2})$ |
Description |
This regular expression will match on a real / decimal / floating point / numeric string with no more than 2 digits past the decimal. The negative sign (-) is allowed. No leading zeroes or commas. It is based on a currency regular expression by Tom Persing. |
Matches |
123 | 123.54 | -.54 |
Non-Matches |
123.543 | 0012 | 1,000.12 |
Author |
Rating:
Not yet rated.
T H
|
Source |
|
Your Rating |
|
Title: without a decimal, how many three digit numbers can be made with two same digits?
Name: lonnie
Date: 1/5/2011 6:36:38 AM
Comment:
anybody have an answer?
Title: one that works on this site
Name: The Fat Man
Date: 12/15/2006 5:52:32 AM
Comment:
none
Title: Trailing decimal character
Name: Roselle
Date: 5/5/2005 3:32:39 PM
Comment:
Using 92. matches. What would I need to add in order to prevent an ending decimal character?
Title: thk
Name: hmvs
Date: 9/6/2004 9:21:00 AM
Comment:
Thank you.