regex for checking numbers only code example
Example 1: just number regex
// https://regex101.com/r/qyq3PG/1
// or
/^[0-9]*$/
Example 2: regex for numbers
Regex regex = new Regex(@"^\d$");
// https://regex101.com/r/qyq3PG/1
// or
/^[0-9]*$/
Regex regex = new Regex(@"^\d$");