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
This matches any real number, with optional decimal point and numbers after the decimal, and optional positive (+) or negative (-) designation.
Matches
123 | -123.45 | +123.56
Non-Matches
123x | .123 | -123.
Author Rating: Not yet rated. Steven Smith
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: 0-prefixed number
Name: Lucian Toza
Date: 12/8/2005 8:51:53 AM
Comment:
try 012


Title: Extra decimal dot
Name: Peter J.
Date: 11/21/2003 6:01:18 PM
Comment:
Try 1.2.3 for instance.


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