I can't figure out what i'm doing wrong here:
I'm trying to validate that a string is a valid integer, using this regular expression and C# code.
private static Regex _intPattern = new Regex( @"[-]?[0-9]+");
public static bool IsValidInteger(string val)
Match match = _intPattern.Match( val );
but that will match anything that has a valid number in it. I want to make sure there is only 1 match, and that the match is the entire string. how should I do that?