C# Regex.IsMatch returns true when it shouldn't?
- by James Cadd
I'm attempting to match a string that can contain any number of numeric characters or a decimal point using the following regex:
([0-9.])*
Here's some C# code to test the regex:
Regex regex = new Regex("([0-9.])*");
if (!regex.IsMatch("a"))
throw new Exception("No match.");
I expect the exception to be thrown here but it isn't - am I…