Your solution is half right. The match you see is for the other characters. What you want to say is something like “hey! I do not want to see this character in the entire string”.
In that case you do:
Regex.IsMatch("103","^[^0]*$")
Your solution is half right. The match you see is for the other characters. What you want to say is something like “hey! I do not want to see this character in the entire string”.
In that case you do:
Regex.IsMatch("103","^[^0]*$")