regular expression to accept only 4 digit numbers code example Example: regex 10 numbers only @"^\d{10}$"