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 Pattern Title
Expression
^(\d{0,4}(?:\.\d{0,2})? | [-]\d{0,2}(?:\.\d{0,2})? )[%]{0,1}$
Description
validates Percents, where Positive numbers are allowed over 100% (in this case up to 9999), but where Negative percents must not go to or below -100% This also allows for the "%" to be present or missing. This was used to validate sales Growth Percents (allows for large positive growth, but you could not go negative for more than 100%).
Matches
1234.56% | 23.32 | -42.23%
Non-Matches
12345% | -200% | 5.1234%
Author Rating: The rating for this expression. Jeff Przylucki
   Displaying page 1 of 1 pages; Items 1 to 1

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