check numeric regex .net core code example
Example 1: regex for numbers
Regex regex = new Regex(@"^\d$");
Example 2: c# see if string is int
bool result = int.TryParse("123", out var n);
Regex regex = new Regex(@"^\d$");
bool result = int.TryParse("123", out var n);