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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Decimal Number
Expression
^\s*(?<sign>[+-]?)(?:0*?)(?<abs_value>(?:(?:[1-9]\d*)|0)?(?:(?<=\d)\.|\.(?=\d))(?:(?:(?:\d*[1-9])|0)?)?|(?:(?:[1-9]\d*)|0)?)(?:0*)\s*$
Description
Parses a decimal number. returns two match groups <sign> and <abs_value>. Accepts empty string.
Matches
0 | 00 | 000 | 0001 | 01 | 10 | 1000 | .0 | 0. | 0.0 | 00.0 | 0.00 | 0.0000 | 000.0 | 0.11000 | 00011.000 | 1.2 | 0.5 | 00.05 | 1 | -5 | -.8 | +9. | -00012.033000 |
Non-Matches
. | 0.1e+1 | 1e-2
Author Rating: Not yet rated. Mihail Poltorihin
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

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