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

Please support RegExLib Sponsors

Sponsors

Expressions by User

   Displaying page 1 of 1 pages; Items 1 to 1
Title Test Details Decimal numbers
Expression
^[+-]?\d+(\.\d{1,4})? *%?$
Description
An expression for .NET regular expression validation controls intended to facilitate the entry of percentage values both a whole numbers or as their decimal representations. Also compatible with the default US format for string formatting for percentages. Recommend that if you intended accept a value passing this express that you strip the percentage signs and take measures to ensure that any whole values are converted to percentages.
Matches
123 | 256.89 | 2% | 0.2% | 25% | 0.1 | 0 | +1.9% | -2
Non-Matches
.1 | %1 | 1.0 | 2,345
Author Rating: The rating for this expression. Mirza Muhammad Saleem
   Displaying page 1 of 1 pages; Items 1 to 1

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