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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Percentage
Expression
^[0]*?(?<Percentage>[1-9][0-9]?|100)%?$
Description
it matches percentage from 1 to 100%. It ignores 0 or 0%. It only support integer matching.
Matches
1% | 99% | 00099% | 99
Non-Matches
101% | 0%
Author Rating: The rating for this expression. Manish
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: it needs some changes but it works
Name: Simona
Date: 6/18/2014 8:50:08 AM
Comment:
I had to chang it in this way: ^[0]*?([1-9][0-9]?|100)%?$ to match what I needed, in this way it match a string containing ONLY a percentage and nothing else


Title: it needs some changes but it works
Name: Simona
Date: 6/18/2014 6:27:59 AM
Comment:
I had to chang it in this way: ^[0]*?([1-9][0-9]?|100)%?$ to match what I needed, in this way it match a string containing ONLY a percentage and nothing else


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