I have a textbox that I created using .NET..
By using that textbox, the user only can key in numeric. But not start with 0. start with 1-9. after the user key in th
As your code is .NET you should not use regex to parse an Integer. Just use UInt32.TryParse() method
uint num=0;
if(UInt32.TryParse(str, out num)){
Console.WriteLine("Converted '{0}' to {1}.", str, num);
}else{
Console.WriteLine("conversion of '{0}' failed.", value==null? "": value);
}
This simple regular expression will do it ^[1-9]\d*$