[Solved] Regex to match integers, decimals and fractions [duplicate]


Give this one a shot:

(\d+[\/\d. ]*|\d)

http://regex101.com/r/oO9yI9

In the future, I’d suggest making your question more clear so we can actually understand what you’re trying to do — provide inputs, expected outputs, and include the programming language you’re using.

vb.net is PCRE compliant, so you should be able to use this:

Dim regex As Regex = New Regex("(\d+[\/\d. ]*|\d)")
Dim match As Match = regex.Match("11.325 x 55.65")
If match.Success Then
    Console.WriteLine(match.Value)
    # this matches, so you'll get a value
End If

solved Regex to match integers, decimals and fractions [duplicate]