RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^-?\d*(\.\d+)?$
Description
Matches all positive & negative decimal floating point numbers, to any magnitude. Allows empty string.
Matches
4.4 | .4 | -.4
Non-Matches
. | ... | zero
Author Rating: The rating for this expression. Murray Roke
Source
Your Rating
Bad Good

Enter New Comment

Title
 
Name
 
Comment
 
Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Pattern Title
Name: Mike
Date: 6/19/2006 5:26:07 PM
Comment:
Actuality, you should be able to take a whgole number like 5 becuase that is 5.0 but this expression does not allow that. A better expression would be ^-?\d*(\.?\d+)?$ - this will allow for whole number beucase they are also decimal floating point numbers


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials