I'm looking for a regular expression that can match integers, decimals and fractions from a string:
Here are some examples
11.325 x 55.65
11x13
11”x13”
11” x 13”
11 3/8 x 15 7/8
11 3/8” x 15 7/8“
Explanation of above examples:
- Two decimals
- Two integers
- Two integers with quote to represent inches
- Same as above but with spaces
- Two integers each followed by a fraction
- Same as above with a quote after fraction for inches
So far I have come up with code that will match any numeric values, i.e. integers and decimals, but I'm stuck on the fractions.
Dim matches = Regex.Matches(curCellVal + "", "[\d.]+")
The above code gives me 6 matches for 11 3/8” x 15 7/8“
, I need it to give me 2.
I'm not competent with regex so any help would be much appreciated.
My language of preference is VB.net.