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:
Bharath N
|
Source |
|
Your Rating |
|
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