I need regex patterns for floating point numbers with optional % sign at the end like
12.32
12.32%
0.32
.32
.32%
arbitrary length of numbers on left and right of floating point numbers. I need this to validate input in asp.net mvc app
UPDATE:
forgot following combinations
12%
35
45%
This regex should do it for you…
Which means… zero or more digits (
\d*) followed by a period (escaped\.) followed by one or more digits (\d+) followed by an optional % (%?)Update: match whole numbers