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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^[0-9]*\/{1}[1-9]{1}[0-9]*$
Description
This regular expression checks if the given string is a fraction. This does not allow 0 either in the numerator or the denominator.
Matches
1/2 | 12/325
Non-Matches
-1/2 | 2se/4rf
Author Rating: The rating for this expression. Bharath N
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: Small change
Name: Bharath
Date: 10/21/2005 12:31:24 AM
Comment:
Small change was done but still doesnot handle /1.


Title: Sorry, but absolutely non-functional...
Name: Daniel Beck
Date: 10/18/2005 5:51:17 PM
Comment:
Your expression allows nonsenses as: 1. "/" 2. "1/" 3. "/1" and does not allow some regular fractions as: "10/101" (basically anything what contains "0") or "1 2/3" Check my one at http://www.regexlib.com/REDetails.aspx?regexp_id=1234


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