C# RegEx for Numbers up to 100
c#, regex
Solution
You're using the `@` sign on your string, so you shouldn't escape \ characters.
All you need is
string pattern = @"^([1-9][0-9]{0,1}(\.[\d]{1,2})?|100)$";
Problem
I created a regex to match numbers from 1-100, including decimals such as 50.25 For some reason, decimal numbers are not matching and I have no idea why. Can someone help? ``` string pattern = @"^([1-9][0-9]{0,1}(\\.[\\d]{1,2})?|100)$"; Regex r = new Regex(pattern); Match m = r.Match(s.SearchRadius); if (!m.Success) { s.SearchRadius = "20"; } ```