I can’t seem to get the syntax correct for a RegularExpression using C# to only allow positive numbers with up to 1 decimal point.
I have the following DataAnnotation for positive integers working:
[RegularExpression(@"[^\-][\d\.]*", ErrorMessage = "Positive integers only")]
Any tips?
You want
^\d+(\.\d)?$.