Title |
Test
Find
Feet-inch to Decimal
|
Expression |
(?:(?:(?<Feet>\d+)[ ]*(?:'|ft)){0,1}[ ]*(?<Inches>\d*(?![/\w])){0,1}(?:[ ,\-]){0,1}(?<Fraction>(?<FracNum>\d*)\/(?<FracDem>\d*)){0,1}(?<Decimal>\.\d*){0,1}(?:\x22| in))|(?:(?<Feet>\d+)[ ]*(?:'|ft)[ ]*){1} |
Description |
I needed an expression that would break down a written measurement, like 12' 2-15/16", into groups of feet, inches, fractional inches (num/dem). This is a modified expression based on Trevor Braun's orginal regex. Added the "ft" & "in" suffixes and the fraction's Numerator & Denominator groups. |
Matches |
1ft 2-3/4 in, 2' 3 4/5", 3ft, 4', 5 in, 6", 7.125 in, 3ft 4.5 in |
Non-Matches |
1ft 2-3/4in, 4in |
Author |
Rating:
Normand Frechette
|
Source |
RegExLib.com |
Your Rating |
|
Title: 6 1/4'
Name: Art Chereiski
Date: 11/2/2012 1:09:44 AM
Comment:
what about 6 1/4' ? It does not get parsed or is the expression incorrect?
Title: 6 1/4'
Name: Art Chereiski
Date: 11/2/2012 1:07:17 AM
Comment:
what about 6 1/4' ? It does not get parsed or is the expression incorrect?
Title: 6 1/4'
Name: Art Chereiski
Date: 11/2/2012 1:07:06 AM
Comment:
what about 6 1/4' ? It does not get parsed or is the expression incorrect?